Add buildlib option; Add wizard script.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2316 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
bernard.xiong@gmail.com
2012-10-05 13:18:00 +00:00
parent 2114b73b4b
commit 3816661798
2 changed files with 97 additions and 0 deletions

View File

@@ -77,6 +77,12 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
default=False,
help='copy header of rt-thread directory to local.')
# add build library option
AddOption('--buildlib',
dest='buildlib',
type='string',
help='building library of a component')
# add target option
AddOption('--target',
dest='target',
@@ -212,6 +218,10 @@ def DefineGroup(name, src, depend, **parameters):
Env.Append(CPPDEFINES = group['CPPDEFINES'])
if group.has_key('LINKFLAGS'):
Env.Append(LINKFLAGS = group['LINKFLAGS'])
if group.has_key('LIBS'):
Env.Append(LIBS = group['LIBS'])
if group.has_key('LIBPATH'):
Env.Append(LIBPATH = group['LIBPATH'])
objs = Env.Object(group['src'])
@@ -237,6 +247,23 @@ def GetCurrentDir():
path = os.path.dirname(fn.abspath)
return path
def DoBuilding(target, objects):
program = None
# check whether special buildlib option
lib_name = GetOption('buildlib')
if lib_name:
print lib_name
# build library with special component
for Group in Projects:
if Group['name'] == lib_name:
objects = Env.Object(Group['src'])
program = Env.Library(lib_name, objects)
break
else:
program = Env.Program(target, objects)
EndBuilding(target, program)
def EndBuilding(target, program = None):
import rtconfig
from keil import MDKProject