2009-10-15 17:49:14 +08:00
|
|
|
import os
|
2010-04-19 06:16:50 +08:00
|
|
|
import sys
|
2009-10-15 17:49:14 +08:00
|
|
|
import rtconfig
|
|
|
|
|
2012-04-09 11:32:35 +08:00
|
|
|
if os.getenv('RTT_ROOT'):
|
|
|
|
RTT_ROOT = os.getenv('RTT_ROOT')
|
|
|
|
else:
|
|
|
|
RTT_ROOT = os.path.normpath(os.getcwd() + '/../..')
|
|
|
|
|
2010-04-19 06:16:50 +08:00
|
|
|
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
|
2010-11-20 20:31:00 +08:00
|
|
|
from building import *
|
2009-10-15 17:49:14 +08:00
|
|
|
|
2010-11-20 20:31:00 +08:00
|
|
|
TARGET = 'rtthread-stm32.' + rtconfig.TARGET_EXT
|
2010-04-19 07:48:59 +08:00
|
|
|
|
2009-10-22 17:44:08 +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)
|
2009-10-15 17:49:14 +08:00
|
|
|
|
2011-02-18 13:08:41 +08:00
|
|
|
if rtconfig.PLATFORM == 'iar':
|
|
|
|
env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES'])
|
2011-07-04 13:50:17 +08:00
|
|
|
env.Replace(ARFLAGS = [''])
|
2011-02-18 13:08:41 +08:00
|
|
|
env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map project.map'])
|
|
|
|
|
2009-10-15 17:49:14 +08:00
|
|
|
Export('RTT_ROOT')
|
|
|
|
Export('rtconfig')
|
|
|
|
|
2010-11-20 20:31:00 +08:00
|
|
|
# prepare building environment
|
|
|
|
objs = PrepareBuilding(env, RTT_ROOT)
|
2009-10-15 17:49:14 +08:00
|
|
|
|
2010-11-20 20:31:00 +08:00
|
|
|
# STM32 firemare library building script
|
2011-09-24 10:51:53 +08:00
|
|
|
objs = objs + SConscript( GetCurrentDir() + '/Libraries/SConscript', variant_dir='build/bsp/Libraries', duplicate=0)
|
2009-10-15 17:49:14 +08:00
|
|
|
|
2011-07-04 15:39:49 +08:00
|
|
|
if GetDepend('RT_USING_RTGUI'):
|
|
|
|
objs = objs + SConscript(RTT_ROOT + '/examples/gui/SConscript', variant_dir='build/examples/gui', duplicate=0)
|
|
|
|
|
2010-11-20 20:31:00 +08:00
|
|
|
# build program
|
2009-10-22 17:44:08 +08:00
|
|
|
env.Program(TARGET, objs)
|
2010-04-19 06:16:50 +08:00
|
|
|
|
2010-11-20 20:31:00 +08:00
|
|
|
# end building
|
|
|
|
EndBuilding(TARGET)
|