mirror of
https://github.com/drasko/codezero.git
synced 2026-01-12 19:03:15 +01:00
42 lines
1.5 KiB
Python
42 lines
1.5 KiB
Python
# -*- mode: python; coding: utf-8; -*-
|
|
#
|
|
# Codezero -- a microkernel for embedded systems.
|
|
#
|
|
# Copyright © 2009 B Labs Ltd
|
|
|
|
import os, sys, shelve
|
|
|
|
arch = 'arm'
|
|
subarch = 'v5'
|
|
platform = 'pb926'
|
|
variant = "baremetal"
|
|
|
|
env = Environment(CC = 'arm-none-eabi-gcc',
|
|
# We don't use -nostdinc because sometimes we need standard headers,
|
|
# such as stdarg.h e.g. for variable args, as in printk().
|
|
CCFLAGS = ['-g', '-mcpu=arm926ej-s', '-nostdlib', '-ffreestanding', \
|
|
'-std=gnu99', '-Wall', '-Werror'],
|
|
LINKFLAGS = ['-nostdlib', '-T' + "include/l4/arch/arm/linker.lds"],
|
|
ASFLAGS = ['-D__ASSEMBLY__'],
|
|
PROGSUFFIX = '.elf', # The suffix to use for final executable
|
|
ENV = {'PATH' : os.environ['PATH']}, # Inherit shell path
|
|
LIBS = 'gcc', # libgcc.a - This is required for division routines.
|
|
CPPPATH = "#include")
|
|
|
|
e = env.Clone()
|
|
e.Append(CPPPATH = ['include/sys-' + variant + '/arch-' + arch])
|
|
e.Append(CCFLAGS = '-nostdinc')
|
|
|
|
source = \
|
|
Glob('src/*.c') + \
|
|
Glob('src/sys-' + variant + '/*.c') + \
|
|
Glob('src/sys-' + variant + '/arch-' + arch + '/*.c') + \
|
|
Glob('src/sys-' + variant + '/arch-' + arch + '/plat-' + platform + '/*.c') + \
|
|
Glob('src/arch-' + arch + '/*.c') + \
|
|
Glob('src/arch-' + arch + '/*.S') + \
|
|
Glob('crt/sys-' + variant + '/arch-' + arch + '/*.[cS]')
|
|
|
|
objects = e.StaticObject(source)
|
|
library = e.StaticLibrary('c-' + variant, objects)
|
|
#runtime = e.StaticObject('crt/sys-' + variant + '/arch-' + arch + '/crt0.S')
|