2010-04-19 16:23:21 +08:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import rtconfig
|
|
|
|
|
|
|
|
RTT_ROOT = os.path.normpath(os.getcwd() + '/../..')
|
|
|
|
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
|
2010-11-20 20:31:00 +08:00
|
|
|
from building import *
|
2010-04-19 16:23:21 +08:00
|
|
|
|
2010-11-20 20:31:00 +08:00
|
|
|
TARGET = 'rtthread-lpc176x.' + rtconfig.TARGET_EXT
|
2010-04-19 16:23:21 +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('RTT_ROOT')
|
|
|
|
Export('rtconfig')
|
|
|
|
|
2010-11-20 20:31:00 +08:00
|
|
|
# prepare building environment
|
|
|
|
objs = PrepareBuilding(env, RTT_ROOT)
|
|
|
|
|
|
|
|
if GetDepend('RT_USING_WEBSERVER'):
|
|
|
|
objs = objs + SConscript(RTT_ROOT + '/components/net/webserver/SConscript', variant_dir='build/net/webserver', duplicate=0)
|
2010-04-19 16:23:21 +08:00
|
|
|
|
2010-11-20 20:31:00 +08:00
|
|
|
if GetDepend('RT_USING_RTGUI'):
|
|
|
|
objs = objs + SConscript(RTT_ROOT + '/examples/gui/SConscript', variant_dir='build/examples/gui', duplicate=0)
|
2010-04-19 16:23:21 +08:00
|
|
|
|
2011-10-14 01:54:59 +08:00
|
|
|
cwd = str(Dir('#'))
|
|
|
|
list = os.listdir(cwd)
|
|
|
|
for d in list:
|
|
|
|
path = os.path.join(cwd, d)
|
|
|
|
if os.path.isfile(os.path.join(path, 'SConscript')):
|
|
|
|
objs = objs + SConscript(os.path.join(d, 'SConscript'))
|
|
|
|
|
2010-11-20 20:31:00 +08:00
|
|
|
# libc testsuite
|
|
|
|
# objs = objs + SConscript(RTT_ROOT + '/examples/libc/SConscript', variant_dir='build/examples/libc', duplicate=0)
|
2010-04-19 16:23:21 +08:00
|
|
|
|
2010-11-20 20:31:00 +08:00
|
|
|
# build program
|
2010-04-19 16:23:21 +08:00
|
|
|
env.Program(TARGET, objs)
|
|
|
|
|
2010-11-20 20:31:00 +08:00
|
|
|
# end building
|
|
|
|
EndBuilding(TARGET)
|