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() + '/../..') # if you want use the rtgui in the svn (in google code), you should # comment the following line RTT_RTGUI = os.path.normpath('F:/Project/git/rt-gui') #RTT_RTGUI ='' 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') libs = Split(''' kernel32 msvcrt winmm user32 gdi32 winspool comdlg32 advapi32 shell32 ole32 oleaut32 uuid odbc32 odbccp32 ''') definitions = Split(''' WIN32 _DEBUG _CONSOLE MSVC _TIME_T_DEFINED ''') env.Append(CCFLAGS=rtconfig.CFLAGS) env.Append(LINKFLAGS=rtconfig.LFLAGS) env['LIBS']=libs env['CPPDEFINES']=definitions # prepare building environment if RTT_RTGUI: objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False, remove_components=['rtgui']) objs += SConscript(os.path.join(RTT_RTGUI + '/components/rtgui', 'SConscript'), variant_dir='build/components/rtgui', duplicate=0) else: objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) if GetDepend('RT_USING_RTGUI'): sdl_lib = ['SDL', 'SDLmain'] sdl_lib_path = os.path.normpath('SDL/lib/x86') sdl_include_path = os.path.normpath('SDL/include') env.Append(LIBS=sdl_lib) env.Append(LIBPATH=sdl_lib_path) env.Append(CPPPATH=sdl_include_path) if RTT_RTGUI: objs = objs + SConscript(RTT_RTGUI+'/demo/examples/SConscript', variant_dir='build/examples/gui', duplicate=0) else: 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)