2009-12-11 17:42:01 +08:00
|
|
|
import os
|
|
|
|
import rtconfig
|
|
|
|
|
|
|
|
RTT_ROOT = os.path.normpath(os.getcwd() + '/../..')
|
2009-12-18 14:06:42 +08:00
|
|
|
target = 'rtthread-mini2440'
|
2009-12-11 17:42:01 +08:00
|
|
|
|
2009-12-18 13:25:41 +08:00
|
|
|
# search path for C compiler
|
2009-12-11 17:42:01 +08:00
|
|
|
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)
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
2009-12-27 21:17:09 +08:00
|
|
|
if rtconfig.RT_USING_RTGUI:
|
|
|
|
objs = objs + SConscript(RTT_ROOT + '/rtgui/SConscript', variant_dir='build/rtgui', duplicate=0)
|
|
|
|
|
2009-12-29 23:08:26 +08:00
|
|
|
src_bsp = ['application.c', 'startup.c', 'board.c']
|
|
|
|
src_drv = ['console.c', 'led.c']
|
2009-12-11 17:42:01 +08:00
|
|
|
|
|
|
|
if rtconfig.RT_USING_DFS:
|
|
|
|
src_drv += ['sdcard.c']
|
|
|
|
|
|
|
|
if rtconfig.RT_USING_LWIP:
|
2009-12-18 13:39:46 +08:00
|
|
|
src_drv += ['dm9000.c']
|
2009-12-11 17:42:01 +08:00
|
|
|
|
2009-12-27 21:17:09 +08:00
|
|
|
if rtconfig.RT_USING_RTGUI:
|
2009-12-29 23:08:26 +08:00
|
|
|
src_drv += ['touch.c', 'key.c']
|
|
|
|
|
|
|
|
if rtconfig.RT_USING_RTGUI:
|
2010-01-01 17:11:09 +08:00
|
|
|
if rtconfig.RT_USING_LCD_TYPE == 'PNL_A70':
|
|
|
|
src_drv += ['lcd_a70.c']
|
|
|
|
elif rtconfig.RT_USING_LCD_TYPE == 'PNL_N35':
|
|
|
|
src_drv += ['lcd_n35.c']
|
|
|
|
elif rtconfig.RT_USING_LCD_TYPE == 'PNL_T35':
|
|
|
|
src_drv += ['lcd_t35.c']
|
2009-12-29 23:08:26 +08:00
|
|
|
|
2009-12-11 17:42:01 +08:00
|
|
|
objs = objs + env.Object(src_bsp + src_drv)
|
|
|
|
|
|
|
|
TARGET = target + '.' + rtconfig.TARGET_EXT
|
|
|
|
env.Program(TARGET, objs)
|
|
|
|
env.AddPostAction(TARGET, rtconfig.POST_ACTION)
|