summaryrefslogtreecommitdiff
path: root/bsp/lpc176x/SConstruct
diff options
context:
space:
mode:
authorbernard.xiong <[email protected]>2010-04-19 08:23:21 +0000
committerbernard.xiong <[email protected]>2010-04-19 08:23:21 +0000
commite6543f3f9df8d03fcee2652a543b026c8b2366d8 (patch)
treef39072d43baa067748c197d5a74a11c9d687cae0 /bsp/lpc176x/SConstruct
parent7b4e04633ee1527ea1251c54a7f235ddd07ebf64 (diff)
update lpc17xx to new building script.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@649 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'bsp/lpc176x/SConstruct')
-rw-r--r--bsp/lpc176x/SConstruct49
1 files changed, 49 insertions, 0 deletions
diff --git a/bsp/lpc176x/SConstruct b/bsp/lpc176x/SConstruct
new file mode 100644
index 0000000000..e3e8593216
--- /dev/null
+++ b/bsp/lpc176x/SConstruct
@@ -0,0 +1,49 @@
+import os
+import sys
+import rtconfig
+
+RTT_ROOT = os.path.normpath(os.getcwd() + '/../..')
+sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
+import mdk
+
+target = 'rtthread-lpc176x'
+projects = []
+
+AddOption('--target',
+ dest='target',
+ type='string',
+ help='set target project: mdk')
+
+if GetOption('target'):
+ SetOption('no_exec', 1)
+
+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('env')
+Export('RTT_ROOT')
+Export('rtconfig')
+Export('projects')
+
+# kernel building script
+objs = SConscript(RTT_ROOT + '/src/SConscript', variant_dir='build/src', duplicate=0)
+# arch building script
+objs = objs + SConscript(RTT_ROOT + '/libcpu/SConscript', variant_dir='build/libcpu', duplicate=0)
+
+# component script
+Repository(RTT_ROOT)
+objs = objs + SConscript('components/SConscript')
+
+# board build script
+objs = objs + SConscript('SConscript', variant_dir='build/bsp', duplicate=0)
+
+TARGET = target + '.' + rtconfig.TARGET_EXT
+env.Program(TARGET, objs)
+env.AddPostAction(TARGET, rtconfig.POST_ACTION)
+
+if GetOption('target') == 'mdk':
+ mdk.MDKProject('project.uV2', projects)