瀏覽代碼

add group script support.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@641 bbd45198-f89e-11dd-88c7-29a3b14d5316
bernard.xiong 15 年之前
父節點
當前提交
5562ddf77a
共有 5 個文件被更改,包括 91 次插入17 次删除
  1. 20 2
      components/SConscript
  2. 22 6
      components/dfs/SConscript
  3. 23 5
      components/finsh/SConscript
  4. 1 1
      components/libc/minilibc/SConscript
  5. 25 3
      components/net/lwip/SConscript

+ 20 - 2
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')

+ 22 - 6
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')

+ 23 - 5
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')

+ 1 - 1
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')

+ 25 - 3
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')