Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Keyboard Man_俊
rt-thread
提交
f5217d6a
R
rt-thread
项目概览
Keyboard Man_俊
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f5217d6a
编写于
7月 25, 2015
作者:
B
Bernard Xiong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Tools] Add LOCAL_* options for group definition
上级
8b7d2fb5
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
52 addition
and
9 deletion
+52
-9
tools/building.py
tools/building.py
+52
-9
未找到文件。
tools/building.py
浏览文件 @
f5217d6a
...
...
@@ -20,6 +20,8 @@
# Change Logs:
# Date Author Notes
# 2015-01-20 Bernard Add copyright information
# 2015-07-25 Bernard Add LOCAL_CCFLAGS/LOCAL_CPPPATH/LOCAL_CPPDEFINES for
# group definition.
#
import
os
...
...
@@ -112,6 +114,8 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
# add program path
env
.
PrependENVPath
(
'PATH'
,
rtconfig
.
EXEC_PATH
)
# add rtconfig.h path
env
.
Append
(
CPPPATH
=
[
str
(
Dir
(
'#'
).
abspath
)])
# add library build action
act
=
SCons
.
Action
.
Action
(
BuildLibInstallAction
,
'Install compiled library... $TARGET'
)
...
...
@@ -186,7 +190,7 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
AddOption
(
'--target'
,
dest
=
'target'
,
type
=
'string'
,
help
=
'set target project: mdk/iar/vs/ua'
)
help
=
'set target project: mdk/
mdk4/
iar/vs/ua'
)
#{target_name:(CROSS_TOOL, PLATFORM)}
tgt_dict
=
{
'mdk'
:(
'keil'
,
'armcc'
),
...
...
@@ -220,7 +224,7 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
AddOption
(
'--verbose'
,
dest
=
'verbose'
,
action
=
'store_true'
,
default
=
Fals
e
,
default
=
Tru
e
,
help
=
'print verbose information during build'
)
if
not
GetOption
(
'verbose'
):
...
...
@@ -333,6 +337,24 @@ def MergeGroup(src_group, group):
src_group
[
'CPPDEFINES'
]
=
src_group
[
'CPPDEFINES'
]
+
group
[
'CPPDEFINES'
]
else
:
src_group
[
'CPPDEFINES'
]
=
group
[
'CPPDEFINES'
]
# for local CCFLAGS/CPPPATH/CPPDEFINES
if
group
.
has_key
(
'LOCAL_CCFLAGS'
):
if
src_group
.
has_key
(
'LOCAL_CCFLAGS'
):
src_group
[
'LOCAL_CCFLAGS'
]
=
src_group
[
'LOCAL_CCFLAGS'
]
+
group
[
'LOCAL_CCFLAGS'
]
else
:
src_group
[
'LOCAL_CCFLAGS'
]
=
group
[
'LOCAL_CCFLAGS'
]
if
group
.
has_key
(
'LOCAL_CPPPATH'
):
if
src_group
.
has_key
(
'LOCAL_CPPPATH'
):
src_group
[
'LOCAL_CPPPATH'
]
=
src_group
[
'LOCAL_CPPPATH'
]
+
group
[
'LOCAL_CPPPATH'
]
else
:
src_group
[
'LOCAL_CPPPATH'
]
=
group
[
'LOCAL_CPPPATH'
]
if
group
.
has_key
(
'LOCAL_CPPDEFINES'
):
if
src_group
.
has_key
(
'LOCAL_CPPDEFINES'
):
src_group
[
'LOCAL_CPPDEFINES'
]
=
src_group
[
'LOCAL_CPPDEFINES'
]
+
group
[
'LOCAL_CPPDEFINES'
]
else
:
src_group
[
'LOCAL_CPPDEFINES'
]
=
group
[
'LOCAL_CPPDEFINES'
]
if
group
.
has_key
(
'LINKFLAGS'
):
if
src_group
.
has_key
(
'LINKFLAGS'
):
src_group
[
'LINKFLAGS'
]
=
src_group
[
'LINKFLAGS'
]
+
group
[
'LINKFLAGS'
]
...
...
@@ -371,13 +393,13 @@ def DefineGroup(name, src, depend, **parameters):
group
[
'src'
]
=
src
if
group
.
has_key
(
'CCFLAGS'
):
Env
.
Append
(
CCFLAGS
=
group
[
'CCFLAGS'
])
Env
.
Append
Unique
(
CCFLAGS
=
group
[
'CCFLAGS'
])
if
group
.
has_key
(
'CPPPATH'
):
Env
.
Append
(
CPPPATH
=
group
[
'CPPPATH'
])
Env
.
Append
Unique
(
CPPPATH
=
group
[
'CPPPATH'
])
if
group
.
has_key
(
'CPPDEFINES'
):
Env
.
Append
(
CPPDEFINES
=
group
[
'CPPDEFINES'
])
Env
.
Append
Unique
(
CPPDEFINES
=
group
[
'CPPDEFINES'
])
if
group
.
has_key
(
'LINKFLAGS'
):
Env
.
Append
(
LINKFLAGS
=
group
[
'LINKFLAGS'
])
Env
.
Append
Unique
(
LINKFLAGS
=
group
[
'LINKFLAGS'
])
# check whether to clean up library
if
GetOption
(
'cleanlib'
)
and
os
.
path
.
exists
(
os
.
path
.
join
(
group
[
'path'
],
GroupLibFullName
(
name
,
Env
))):
...
...
@@ -394,13 +416,15 @@ def DefineGroup(name, src, depend, **parameters):
else
:
group
[
'LIBPATH'
]
=
[
GetCurrentDir
()]
if
group
.
has_key
(
'LIBS'
):
Env
.
Append
(
LIBS
=
group
[
'LIBS'
])
Env
.
Append
Unique
(
LIBS
=
group
[
'LIBS'
])
if
group
.
has_key
(
'LIBPATH'
):
Env
.
Append
(
LIBPATH
=
group
[
'LIBPATH'
])
Env
.
Append
Unique
(
LIBPATH
=
group
[
'LIBPATH'
])
# check whether to build group library
if
group
.
has_key
(
'LIBRARY'
):
objs
=
Env
.
Library
(
name
,
group
[
'src'
])
else
:
# only add source
objs
=
group
[
'src'
]
# merge group
...
...
@@ -456,6 +480,26 @@ def BuildLibInstallAction(target, source, env):
break
def
DoBuilding
(
target
,
objects
):
# remove source files with local flags setting
for
group
in
Projects
:
if
group
.
has_key
(
'LOCAL_CCFLAGS'
)
or
group
.
has_key
(
'LOCAL_CPPPATH'
)
or
group
.
has_key
(
'LOCAL_CPPDEFINES'
):
for
source
in
group
[
'src'
]:
for
obj
in
objects
:
if
source
.
abspath
==
obj
.
abspath
or
(
len
(
obj
.
sources
)
>
0
and
source
.
abspath
==
obj
.
sources
[
0
].
abspath
):
objects
.
remove
(
obj
)
# re-add the source files to the objects
for
group
in
Projects
:
if
group
.
has_key
(
'LOCAL_CCFLAGS'
)
or
group
.
has_key
(
'LOCAL_CPPPATH'
)
or
group
.
has_key
(
'LOCAL_CPPDEFINES'
):
CCFLAGS
=
Env
.
get
(
'CCFLAGS'
,
''
)
+
group
.
get
(
'LOCAL_CCFLAGS'
,
''
)
CPPPATH
=
Env
.
get
(
'CPPPATH'
,
[
''
])
+
group
.
get
(
'LOCAL_CPPPATH'
,
[
''
])
CPPDEFINES
=
Env
.
get
(
'CPPDEFINES'
,
[
''
])
+
group
.
get
(
'LOCAL_CPPDEFINES'
,
[
''
])
for
source
in
group
[
'src'
]:
objects
+=
Env
.
Object
(
source
,
CCFLAGS
=
CCFLAGS
,
CPPPATH
=
CPPPATH
,
CPPDEFINES
=
CPPDEFINES
)
program
=
None
# check whether special buildlib option
lib_name
=
GetOption
(
'buildlib'
)
...
...
@@ -500,7 +544,6 @@ def EndBuilding(target, program = None):
else
:
print
'No template project file found.'
if
GetOption
(
'target'
)
==
'mdk4'
:
from
keil
import
MDK4Project
MDK4Project
(
'project.uvproj'
,
Projects
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录