2012-10-21 12:33:52 +08:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import rtconfig
|
|
|
|
|
|
|
|
if os.getenv('RTT_ROOT'):
|
|
|
|
RTT_ROOT = os.getenv('RTT_ROOT')
|
|
|
|
else:
|
|
|
|
RTT_ROOT = os.path.normpath(os.getcwd() + '/../..')
|
|
|
|
|
|
|
|
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
|
|
|
|
from building import *
|
|
|
|
|
|
|
|
TARGET = 'rtthread-win32.' + rtconfig.TARGET_EXT
|
|
|
|
|
|
|
|
env = Environment()
|
|
|
|
|
|
|
|
Export('RTT_ROOT')
|
|
|
|
Export('rtconfig')
|
|
|
|
|
|
|
|
# prepare building environment
|
|
|
|
|
|
|
|
libs = Split('''
|
|
|
|
kernel32
|
|
|
|
msvcrt
|
|
|
|
winmm
|
|
|
|
user32
|
|
|
|
gdi32
|
|
|
|
winspool
|
|
|
|
comdlg32
|
|
|
|
advapi32
|
|
|
|
shell32
|
|
|
|
ole32
|
|
|
|
oleaut32
|
|
|
|
uuid
|
|
|
|
odbc32
|
|
|
|
odbccp32
|
|
|
|
''')
|
2012-11-07 13:32:29 +08:00
|
|
|
definitions = Split('''
|
|
|
|
WIN32
|
|
|
|
_DEBUG
|
|
|
|
_CONSOLE
|
|
|
|
MSVC
|
|
|
|
_TIME_T_DEFINED
|
|
|
|
''')
|
2012-10-21 12:33:52 +08:00
|
|
|
|
|
|
|
env.Append(CCFLAGS=rtconfig.CFLAGS)
|
|
|
|
env.Append(LINKFLAGS=rtconfig.LFLAGS)
|
|
|
|
env['LIBS']=libs
|
2012-11-07 13:32:29 +08:00
|
|
|
env['CPPDEFINES']=definitions
|
2012-10-21 12:33:52 +08:00
|
|
|
|
|
|
|
objs = PrepareBuilding(env, RTT_ROOT)
|
|
|
|
|
|
|
|
# firemare library building script
|
|
|
|
# objs = objs + SConscript( GetCurrentDir() + '/Libraries/SConscript', variant_dir='build/bsp/Libraries', duplicate=0)
|
|
|
|
|
|
|
|
if GetDepend('RT_USING_RTGUI'):
|
|
|
|
objs = objs + SConscript(RTT_ROOT + '/examples/gui/SConscript', variant_dir='build/examples/gui', duplicate=0)
|
|
|
|
|
|
|
|
# build program
|
|
|
|
env.Program(TARGET, objs)
|
|
|
|
|
|
|
|
# end building
|
|
|
|
EndBuilding(TARGET)
|