diff options
| author | bernard.xiong <[email protected]> | 2010-04-18 15:27:13 +0000 |
|---|---|---|
| committer | bernard.xiong <[email protected]> | 2010-04-18 15:27:13 +0000 |
| commit | 5562ddf77a068f43cd94390f914afb72dc5e2142 (patch) | |
| tree | a2ce0eced1baf167aa007dbef8c7b63ac1333e9c | |
| parent | d307a74a60ef94b80f2e1b66f83232171c5cb1b0 (diff) | |
add group script support.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@641 bbd45198-f89e-11dd-88c7-29a3b14d5316
| -rw-r--r-- | components/SConscript | 22 | ||||
| -rw-r--r-- | components/dfs/SConscript | 28 | ||||
| -rw-r--r-- | components/finsh/SConscript | 28 | ||||
| -rw-r--r-- | components/libc/minilibc/SConscript | 2 | ||||
| -rw-r--r-- | components/net/lwip/SConscript | 28 |
5 files changed, 91 insertions, 17 deletions
diff --git a/components/SConscript b/components/SConscript index 0f0065d8f4..4357552017 100644 --- a/components/SConscript +++ b/components/SConscript @@ -3,8 +3,26 @@ Import('env') Import('rtconfig')
# build each components
+objs = ''
+
+if rtconfig.RT_USING_MINILIBC:
+ objs = objs + SConscript('libc/minilibc/SConscript')
+
+if rtconfig.RT_USING_FINSH:
+ objs = objs + SConscript('finsh/SConscript')
+
+if rtconfig.RT_USING_DFS:
+ objs = objs + SConscript('dfs/SConscript')
+
+if rtconfig.RT_USING_LWIP:
+ objs = objs + SConscript('net/lwip/SConscript')
+
+if rtconfig.RT_USING_RTGUI:
+ objs = objs + SConscript('rtgui/SConscript')
# build each modules
-SConscript('hello/SConscript')
-SConscript('thread/SConscript')
+if rtconfig.CROSS_TOOL == 'gcc':
+ SConscript('hello/SConscript')
+ SConscript('thread/SConscript')
+Return('objs')
diff --git a/components/dfs/SConscript b/components/dfs/SConscript index 48ccc84c15..d8511cd7f7 100644 --- a/components/dfs/SConscript +++ b/components/dfs/SConscript @@ -1,6 +1,7 @@ Import('env')
Import('rtconfig')
Import('RTT_ROOT')
+Import('projects')
dfs = Split("""
src/dfs_fs.c
@@ -47,20 +48,35 @@ filesystems/yaffs2/yaffs_checkptrw.c filesystems/yaffs2/yaffs_qsort.c
""")
-# The set of source files associated with this SConscript file.
src_local = dfs
-path = [RTT_ROOT + '/filesystem/dfs', RTT_ROOT + '/filesystem/dfs/include']
+# The set of source files associated with this SConscript file.
+path = [RTT_ROOT + '/components/dfs', RTT_ROOT + '/components/dfs/include']
if rtconfig.RT_USING_DFS_YAFFS2:
src_local = src_local + yaffs2_main + yaffs2_comm
- path = path + [RTT_ROOT + '/filesystem/dfs/filesystems/yaffs2', RTT_ROOT + '/filesystem/dfs/filesystems/yaffs2/direct']
+ path = path + [RTT_ROOT + '/components/dfs/filesystems/yaffs2', RTT_ROOT + '/components/dfs/filesystems/yaffs2/direct']
if rtconfig.RT_USING_DFS_ELMFAT:
src_local = src_local + elmfat
- path = path + [RTT_ROOT + '/filesystem/dfs/filesystems/elmfat']
+ # path = path + [RTT_ROOT + '/components/dfs/filesystems/elmfat']
+
+# group definitions
+group = {}
+group['name'] = 'Filesystem'
+group['src'] = File(src_local)
+group['CCFLAGS'] = ''
+group['CPPPATH'] = path
+group['CPPDEFINES'] = ''
+group['LINKFLAGS'] = ''
+
+# add group to project list
+projects.append(group)
-env.Append(CPPPATH = path)
+env.Append(CCFLAGS = group['CCFLAGS'])
+env.Append(CPPPATH = group['CPPPATH'])
+env.Append(CPPDEFINES = group['CPPDEFINES'])
+env.Append(LINKFLAGS = group['LINKFLAGS'])
-obj = env.Object(src_local)
+obj = env.Object(group['src'])
Return('obj')
diff --git a/components/finsh/SConscript b/components/finsh/SConscript index 0a638c10aa..5b6e9b1278 100644 --- a/components/finsh/SConscript +++ b/components/finsh/SConscript @@ -1,10 +1,28 @@ Import('env')
+Import('projects')
Import('RTT_ROOT')
+Import('rtconfig')
-# The set of source files associated with this SConscript file.
-src_local = Glob('*.c')
+# group definitions
+group = {}
+group['name'] = 'finsh'
+group['src'] = Glob('*.c')
+group['CCFLAGS'] = ''
+group['CPPPATH'] = [RTT_ROOT + '/components/finsh']
+group['CPPDEFINES'] = ''
+if rtconfig.CROSS_TOOL == 'keil':
+ group['LINKFLAGS'] = ' --keep __fsym_* --keep __vsym_*'
+else:
+ group['LINKFLAGS'] = ''
-env.Append(CPPPATH = RTT_ROOT + '/finsh')
+# add group to project list
+projects.append(group)
-obj = env.Object(src_local)
-Return('obj')
+env.Append(CCFLAGS = group['CCFLAGS'])
+env.Append(CPPPATH = group['CPPPATH'])
+env.Append(CPPDEFINES = group['CPPDEFINES'])
+env.Append(LINKFLAGS = group['LINKFLAGS'])
+
+objs = env.Object(group['src'])
+
+Return('objs')
diff --git a/components/libc/minilibc/SConscript b/components/libc/minilibc/SConscript index 729d2fea00..8b4a2ba786 100644 --- a/components/libc/minilibc/SConscript +++ b/components/libc/minilibc/SConscript @@ -4,7 +4,7 @@ Import('RTT_ROOT') # The set of source files associated with this SConscript file.
src_local = Glob('*.c')
-env.Append(CPPPATH = RTT_ROOT + '/libc/minilibc')
+env.Append(CPPPATH = RTT_ROOT + '/components/libc/minilibc')
obj = env.Object(src_local)
Return('obj')
diff --git a/components/net/lwip/SConscript b/components/net/lwip/SConscript index de08af6688..e58ee3bf42 100644 --- a/components/net/lwip/SConscript +++ b/components/net/lwip/SConscript @@ -1,6 +1,7 @@ Import('env')
Import('rtconfig')
Import('RTT_ROOT')
+Import('projects')
src_local = Split("""
src/api/api_lib.c
@@ -60,10 +61,31 @@ src/netif/ppp/vj.c """)
# The set of source files associated with this SConscript file.
-path = [RTT_ROOT + '/net/lwip/src', RTT_ROOT + '/net/lwip/src/include', RTT_ROOT + '/net/lwip/src/include/ipv4', RTT_ROOT + '/net/lwip/src/arch/include', RTT_ROOT + '/net/lwip/src/include/netif', RTT_ROOT + '/net/lwip/src/netif/ppp']
+path = [RTT_ROOT + '/components/net/lwip/src',
+ RTT_ROOT + '/components/net/lwip/src/include',
+ RTT_ROOT + '/components/net/lwip/src/include/ipv4',
+ RTT_ROOT + '/components/net/lwip/src/arch/include',
+ RTT_ROOT + '/components/net/lwip/src/include/netif',
+ RTT_ROOT + '/components/net/lwip/src/netif/ppp']
-env.Append(CPPPATH = path)
+# group definitions
+print 'LwIP group=='
+group = {}
+group['name'] = 'LwIP'
+group['src'] = File(src_local)
+group['CCFLAGS'] = ''
+group['CPPPATH'] = path
+group['CPPDEFINES'] = ''
+group['LINKFLAGS'] = ''
-obj = env.Object(src_local)
+# add group to project list
+projects.append(group)
+
+env.Append(CCFLAGS = group['CCFLAGS'])
+env.Append(CPPPATH = group['CPPPATH'])
+env.Append(CPPDEFINES = group['CPPDEFINES'])
+env.Append(LINKFLAGS = group['LINKFLAGS'])
+
+obj = env.Object(group['src'])
Return('obj')
|
