summaryrefslogtreecommitdiff
path: root/bsp/simulator/SConstruct
diff options
context:
space:
mode:
authorprife <[email protected]>2013-02-27 00:37:57 +0800
committerprife <[email protected]>2013-02-27 00:37:57 +0800
commita64ec10e68cbc17db2aaf736205cda2ada45ac65 (patch)
tree161c30f2da7bd289b104a86d5393a3263817c3eb /bsp/simulator/SConstruct
parent242574a36ff05d6d109c09144b6f7fab8c88c407 (diff)
app module support for simlator, first version
Diffstat (limited to 'bsp/simulator/SConstruct')
-rwxr-xr-xbsp/simulator/SConstruct41
1 files changed, 39 insertions, 2 deletions
diff --git a/bsp/simulator/SConstruct b/bsp/simulator/SConstruct
index 875bef1e3a..6f35921ba9 100755
--- a/bsp/simulator/SConstruct
+++ b/bsp/simulator/SConstruct
@@ -106,8 +106,45 @@ if GetDepend('RT_USING_RTGUI'):
if GetDepend('RT_USING_TC'):
objs = objs + SConscript(RTT_ROOT + '/examples/kernel/SConscript', variant_dir = 'build/tc/kernel', duplicate=0)
-# build program
-program = env.Program(TARGET, objs)
+def ObjRemove(objs, remove):
+ for item in objs:
+ # print type(item), os.path.basename(str(item))
+ if os.path.basename(str(item)) in remove:
+ objs.remove(item)
+ return
+
+# build program -shared
+if GetDepend('RT_USING_MODULE'):
+ # Remove module.c in $RTT_ROOT/src
+ ObjRemove(objs, ['module.obj', 'module.o'])
+
+ AddOption('--def',
+ dest='def',
+ nargs=1, type='string',
+ action='store',
+ metavar='DIR',
+ help='installation prefix')
+ res = GetOption('def')
+ if res is None:
+ program = env.Program(TARGET, objs)
+ elif res == 'update':
+ env['LINKFLAGS'] = rtconfig.DEFFILE_LFLAGS
+ env.SharedLibrary("rtthread.dll", objs)
+ program = ''
+ elif res == 'yes':
+ if rtconfig.PLATFORM == 'cl':
+ objs += ['rtthread.def']
+ env.SharedLibrary("rtthread.dll", objs)
+ program = env.Program(TARGET, 'dummy.c', LIBS='rtthread', LIBPATH='.')
+ else:
+ print "bad arguments, you can use the following command:"
+ print "\t --def=update to create .def"
+ print "\t --def=yes to create final exe"
+ exit()
+
+else:
+ # env.SharedLibrary("rtthread.dll", objs)
+ program = env.Program(TARGET, objs)
# end building
EndBuilding(TARGET, program)