1 Import('env', 'config')
3 LD_SCRIPT = 'arch/' + config.ARCH + '/mach-' + config.MACH + '/ld/' + config.CHIP + '.ld'
4 cfl = '-mcpu=cortex-m3 -mthumb -ffunction-sections -fno-builtin'
5 ldf = '-mcpu=cortex-m3 -mthumb -nostartfiles -Xlinker --gc-sections -Xlinker -M -Xlinker -Map='+config.NAME+'.map -T'+LD_SCRIPT
8 #env['CPPPATH'].append(['arch/'+config.ARCH+'/mach-'+config.MACH+'/include/'])
9 # disable linking with libc, if nothing else, to see what uses libc
10 if ARGUMENTS.get('LIBC') == '0':
11 ldf += ' -nodefaultlibs -nostdlib'
13 env.Append(ASFLAGS = ['-mcpu=cortex-m3'])
14 env.Append(CFLAGS = cfl.split())
15 env.Append(LINKFLAGS = ldf.split())
18 SRCS = 'crt.c debug.c sched.c interrupt.c'
19 SUBDIRS = 'mach-'+config.MACH
21 obj = [ Object(i) for i in Split(SRCS) ]
22 obj.append(SConscript([ i+'/SConscript' for i in Split(SUBDIRS) ]))