2009-12-11 17:42:01 +08:00
|
|
|
import os
|
2010-04-19 13:42:12 +08:00
|
|
|
import sys
|
2009-12-11 17:42:01 +08:00
|
|
|
import rtconfig
|
|
|
|
|
|
|
|
RTT_ROOT = os.path.normpath(os.getcwd() + '/../..')
|
2010-04-19 13:42:12 +08:00
|
|
|
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
|
|
|
|
import mdk
|
|
|
|
|
2009-12-18 14:06:42 +08:00
|
|
|
target = 'rtthread-mini2440'
|
2010-04-19 13:42:12 +08:00
|
|
|
projects = []
|
|
|
|
|
|
|
|
AddOption('--target',
|
|
|
|
dest='target',
|
|
|
|
type='string',
|
|
|
|
help='set target project: mdk')
|
2009-12-11 17:42:01 +08:00
|
|
|
|
2010-04-19 13:42:12 +08:00
|
|
|
if GetOption('target'):
|
|
|
|
SetOption('no_exec', 1)
|
2009-12-11 17:42:01 +08:00
|
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
Export('env')
|
|
|
|
Export('RTT_ROOT')
|
|
|
|
Export('rtconfig')
|
2010-04-19 13:42:12 +08:00
|
|
|
Export('projects')
|
2009-12-11 17:42:01 +08:00
|
|
|
|
|
|
|
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)
|
|
|
|
|
2010-01-10 23:15:27 +08:00
|
|
|
if rtconfig.RT_USING_WEBSERVER:
|
2010-04-19 13:42:12 +08:00
|
|
|
objs = objs + SConscript(RTT_ROOT + '/components/net/webserver/SConscript', variant_dir='build/net/webserver', duplicate=0)
|
2010-01-10 23:15:27 +08:00
|
|
|
|
2009-12-27 21:17:09 +08:00
|
|
|
if rtconfig.RT_USING_RTGUI:
|
2010-02-01 07:51:09 +08:00
|
|
|
objs = objs + SConscript(RTT_ROOT + '/examples/gui/SConscript', variant_dir='build/examples/gui', duplicate=0)
|
2009-12-27 21:17:09 +08:00
|
|
|
|
2010-04-19 13:42:12 +08:00
|
|
|
# board build script
|
|
|
|
objs = objs + SConscript('SConscript', variant_dir='build/bsp', duplicate=0)
|
2009-12-29 23:08:26 +08:00
|
|
|
|
2010-04-19 13:42:12 +08:00
|
|
|
# component script
|
|
|
|
Repository(RTT_ROOT)
|
|
|
|
objs = objs + SConscript('components/SConscript')
|
2009-12-11 17:42:01 +08:00
|
|
|
|
|
|
|
TARGET = target + '.' + rtconfig.TARGET_EXT
|
|
|
|
env.Program(TARGET, objs)
|
|
|
|
env.AddPostAction(TARGET, rtconfig.POST_ACTION)
|
2010-04-16 14:19:24 +08:00
|
|
|
|
2010-04-19 13:42:12 +08:00
|
|
|
if GetOption('target') == 'mdk':
|
2010-04-19 13:54:21 +08:00
|
|
|
mdk.MDKProject('project.uV2', projects)
|