SConstruct 1.7 KB
Newer Older
1 2 3 4
import os
import rtconfig

RTT_ROOT = os.path.normpath(os.getcwd() + '/../..')
B
bernard.xiong 已提交
5
target = 'rtthread-mini2440'
6

B
bernard.xiong 已提交
7
# search path for C compiler
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
bsp_path  = RTT_ROOT + '/bsp/mini2440'

env = Environment(tools = ['mingw'],
	AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
	CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
	AR = rtconfig.AR, ARFLAGS = '-rc',
	LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
env.AppendUnique(CPPPATH = bsp_path)
env.AppendUnique(CCFLAGS = ' -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD')

Export('env')
Export('RTT_ROOT')
Export('rtconfig')

objs = SConscript(RTT_ROOT + '/src/SConscript', variant_dir='build/src', duplicate=0)
objs = objs + SConscript(RTT_ROOT + '/libcpu/SConscript', variant_dir='build/libcpu', duplicate=0)

if rtconfig.RT_USING_MINILIBC:
	objs = objs + SConscript(RTT_ROOT + '/libc/minilibc/SConscript', variant_dir='build/minilibc', duplicate=0)

if rtconfig.RT_USING_FINSH:
	objs = objs + SConscript(RTT_ROOT + '/finsh/SConscript', variant_dir='build/finsh', duplicate=0)

if rtconfig.RT_USING_DFS:
	objs = objs + SConscript(RTT_ROOT + '/filesystem/dfs/SConscript', variant_dir='build/filesystem', duplicate=0)

if rtconfig.RT_USING_LWIP:
	objs = objs + SConscript(RTT_ROOT + '/net/lwip/SConscript', variant_dir='build/net/lwip', duplicate=0)

src_bsp = ['application.c', 'startup.c', 'board.c']
B
bernard.xiong 已提交
39
src_drv = ['console.c']
40 41 42 43 44

if rtconfig.RT_USING_DFS:
	src_drv += ['sdcard.c']

if rtconfig.RT_USING_LWIP:
45
	src_drv += ['dm9000.c']
46 47 48 49 50 51

objs = objs + env.Object(src_bsp + src_drv)

TARGET = target + '.' + rtconfig.TARGET_EXT
env.Program(TARGET, objs)
env.AddPostAction(TARGET, rtconfig.POST_ACTION)