mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-12-26 09:08:25 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user