mirror of
https://github.com/drasko/codezero.git
synced 2026-01-12 02:43:15 +01:00
49 lines
1.4 KiB
Python
49 lines
1.4 KiB
Python
# -*- mode: python; coding: utf-8; -*-
|
|
#
|
|
# Codezero -- a microkernel for embedded systems.
|
|
#
|
|
# Copyright © 2009 B Labs Ltd
|
|
#
|
|
import os, sys
|
|
|
|
PROJRELROOT = '../..'
|
|
|
|
sys.path.append(PROJRELROOT)
|
|
|
|
from config.projpaths import *
|
|
from config.configuration import *
|
|
|
|
config = configuration_retrieve()
|
|
gcc_arch_flag = config.gcc_arch_flag
|
|
arch = config.arch
|
|
subarch = config.subarch
|
|
|
|
LIBMEM_RELDIR = 'conts/libmem'
|
|
LIBMEM_DIR = join(PROJROOT, LIBMEM_RELDIR)
|
|
|
|
LIBC_RELDIR = 'conts/libc'
|
|
LIBC_DIR = join(PROJROOT, LIBC_RELDIR)
|
|
LIBC_INC = join(LIBC_DIR, 'include')
|
|
|
|
env = Environment(CC = config.toolchain_userspace + 'gcc',
|
|
CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', \
|
|
'-nostdinc', '-Wall', '-Werror', '-march=' + gcc_arch_flag],
|
|
LINKFLAGS = ['-nostdlib'],
|
|
ASFLAGS = ['-D__ASSEMBLY__'],
|
|
ENV = {'PATH' : os.environ['PATH']},
|
|
CPPPATH = ['include', 'include/l4lib/arch', LIBC_INC, \
|
|
join(PROJROOT,'include'), LIBMEM_DIR],
|
|
CPPFLAGS = ' -include l4lib/macros.h ')
|
|
|
|
objects = env.StaticObject(Glob('src/*.c') + \
|
|
Glob('src/lib/*.c') + \
|
|
Glob('src/arch/' + arch + '/exregs.c') + \
|
|
Glob('src/arch/' + arch + '/*.[cS]') + \
|
|
Glob('src/arch/' + arch + '/' + subarch + '/*.[cS]') + \
|
|
Glob('src/lib/cap/*.c')) + \
|
|
Glob('src/lib/thread/*.c')
|
|
|
|
|
|
library = env.StaticLibrary('l4', objects)
|
|
|