瀏覽代碼

add module building script.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@627 bbd45198-f89e-11dd-88c7-29a3b14d5316
bernard.xiong 15 年之前
父節點
當前提交
04fa66ca3d
共有 5 個文件被更改,包括 25 次插入9 次删除
  1. 10 0
      components/SConscript
  2. 5 3
      components/hello/SConscript
  3. 0 3
      components/hello/mk.bat
  4. 10 0
      components/thread/SConscript
  5. 0 3
      components/thread/mk.bat

+ 10 - 0
components/SConscript

@@ -0,0 +1,10 @@
+# for module compile 
+Import('env')
+Import('rtconfig')
+
+# build each components
+
+# build each modules
+SConscript('hello/SConscript')
+SConscript('thread/SConscript')
+

+ 5 - 3
components/hello/SConscript

@@ -1,8 +1,10 @@
 Import('env')
 Import('env')
 
 
-src = ('hello.c')
+target = 'hello.mo'
 
 
-obj = env.Object(src)
+module_env = env.Clone(CPPDEFINE = 'RT_MODULE')
+module_env.Replace(LINKFLAGS = ' -r -d -e rtm_main -nostdlib')
 
 
-Return('obj')
+src_local = Glob('*.c')
 
 
+module_env.Program(target, src_local)

+ 0 - 3
components/hello/mk.bat

@@ -1,3 +0,0 @@
-set PATH="E:\Program Files\CodeSourcery\Sourcery G++ Lite\bin";%PATH%
-arm-none-eabi-gcc -c hello.c -o hello.o -DRT_MODULE "-I..\..\include" "-I..\..\bsp\mini2440"
-arm-none-eabi-gcc -o hello.mo -r -d -e rtm_main -nostdlib hello.o

+ 10 - 0
components/thread/SConscript

@@ -0,0 +1,10 @@
+Import('env')
+
+target = 'thread.mo'
+
+module_env = env.Clone(CPPDEFINE = 'RT_MODULE')
+module_env.Replace(LINKFLAGS = ' -r -d -e rtm_main -nostdlib')
+
+src_local = Glob('*.c')
+
+module_env.Program(target, src_local)

+ 0 - 3
components/thread/mk.bat

@@ -1,3 +0,0 @@
-set PATH="E:\Program Files\CodeSourcery\Sourcery G++ Lite\bin";%PATH%
-arm-none-eabi-gcc -c module_thread_dynamic.c -o module_thread_dynamic.o -DRT_MODULE "-I..\..\include" "-I..\..\bsp\mini2440"
-arm-none-eabi-gcc -o dynamic.mo -r -d -e rtm_main -nostdlib module_thread_dynamic.o