import re import rtems def build(bld): arch = bld.get_env()['RTEMS_ARCH'] bld(target = 'x', features = 'c cstlib', includes = bld.includes, defines = bld.defines, source = ['1.c', '2.c']) # Note: the bsp is compiled in thumb mode # The follow cflags is to test arm/thumb reloc code. # cflags = '-marm -fno-common -DARM_TEST', # cflags = '-mthumb -fno-common -DTHUMB_TEST', # cflags = '-marm -mcpu=arm1176jzf-s -fno-common -DARM_TEST', ############ For ar rap ################# bld(target = '3', features = 'c cstlib', includes = bld.includes, cflags = '-fno-common', defines = bld.defines, source = ['3.c', '33.c', '333.c']) bld(target = '../lib3.ra', rule = 'touch ../lib3.ra') bld( features = 'c ra', xxxx = 'hello', cflags = '-fno-common', rtems_raflags = ['--lib', '3', '--lib-path', 'testcase', '--output-path', './', '--no-stdlibs'],) bld(target = 'my.rap', features = 'c rap', xxxx = 'hello', cflags = '-fno-common', rtems_linkflags = ['--base', 'rtld.prelink', '--entry', 'rtems', '--lib-path', 'testcase', '--lib', '3', '--runtime-lib', 'ttt'], source = ['4.c']) bld(target = '../libttt.ra', rule = 'touch ../libttt.ra') ##############End######################## if arch == 'arm': bld(target = 'test.rap', features = 'c rap', xxxx = 'hello', cflags = '-mthumb -fno-common -DTHUMB_TEST', rtems_linkflags = ['--base', 'rtld.prelink', '--entry', 'my_main'], source = ['1.c', '2.c']) elif arch == 'powerpc': bld(target = 'test.rap', features = 'c rap', xxxx = 'hello', cflags = '-fno-common -DPPC_TEST', rtems_linkflags = ['--base', 'rtld.prelink', '--entry', 'my_main'], source = ['1.c', '2.c']) elif arch == 'mips': # cflags = '-fno-common -mlong-calls' bld(target = 'test.rap', features = 'c rap', xxxx = 'hello', cflags = '-fno-common', rtems_linkflags = ['--base', 'rtld.prelink', '--entry', 'my_main', '-a', 'mips'], source = ['1.c', '2.c']) elif arch == 'sparc': bld(target = 'test.rap', features = 'c rap', xxxx = 'hello', cflags = '-fno-common', rtems_linkflags = ['--base', 'rtld.prelink', '--entry', 'my_main'], source = ['1.c', '2.c']) elif arch == 'bfin': # cflags = '-fno-common -mlong-calls' bld(target = 'test.rap', features = 'c rap', xxxx = 'hello', cflags = '-fno-common', rtems_linkflags = ['--base', 'rtld.prelink', '--entry', '_my_main'], source = ['1.c', '2.c']) elif arch == 'h8300': bld(target = 'test.rap', features = 'c rap', xxxx = 'hello', cflags = '-fno-common', rtems_linkflags = ['--base', 'rtld.prelink', '--entry', '_my_main'], source = ['1.c', '2.c']) elif arch == 'lm32' or arch == 'moxie': bld(target = 'test.rap', features = 'c rap', xxxx = 'hello', cflags = '-fno-common', rtems_linkflags = ['--base', 'rtld.prelink', '--entry', 'my_main'], source = ['1.c', '2.c']) elif arch == 'v850': # cflags = '-mlong-calls -fno-common', bld(target = 'test.rap', features = 'c rap', xxxx = 'hello', cflags = '-fno-common', rtems_linkflags = ['--base', 'rtld.prelink', '--entry', '_my_main'], source = ['1.c', '2.c']) elif arch == 'm32r': # cflags = '-fno-common, -mmodel=large', # cflags = '-fno-common -mmodel=medium', bld(target = 'test.rap', features = 'c rap', xxxx = 'hello', cflags = '-fno-common', rtems_linkflags = ['--base', 'rtld.prelink', '--entry', 'my_main'], source = ['1.c', '2.c']) elif arch == 'm68k': bld(target = 'test.rap', features = 'c rap', xxxx = 'hello', cflags = '-fno-common', rtems_linkflags = ['--base', 'rtld.prelink', '--entry', 'my_main'], source = ['1.c', '2.c']) bld(target = '../test.rap', source = ['test.rap'], rule = 'cp ${SRC} ${TGT}') bld(target = '../my.rap', source = ['my.rap'], rule = 'cp ${SRC} ${TGT}')