summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorbernard <[email protected]>2014-11-01 21:52:26 +0800
committerbernard <[email protected]>2014-11-01 21:52:26 +0800
commita00cc57487f78629bf3aaa7c3c04708af6fa0800 (patch)
tree9ff51facb280baa4d427da3ad05bf07b70782876 /tools
parentc7ee7f9858f2cc86d94a2eea8baacfc449865e9a (diff)
Prepare RT-Thread 1.2.3 release.
Diffstat (limited to 'tools')
-rw-r--r--tools/building.py22
-rw-r--r--tools/keil.py24
2 files changed, 18 insertions, 28 deletions
diff --git a/tools/building.py b/tools/building.py
index 83f034deb3..79e6fd1a4b 100644
--- a/tools/building.py
+++ b/tools/building.py
@@ -27,11 +27,9 @@ class Win32Spawn:
newargs = string.join(args[1:], ' ')
cmdline = cmd + " " + newargs
- startupinfo = subprocess.STARTUPINFO()
- startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
# Make sure the env is constructed by strings
- _e = {k: str(v) for k, v in env.items()}
+ _e = dict([(k, str(v)) for k, v in env.items()])
# Windows(tm) CreateProcess does not use the env passed to it to find
# the executables. So we have to modify our own PATH to make Popen
@@ -40,8 +38,7 @@ class Win32Spawn:
os.environ['PATH'] = _e['PATH']
try:
- proc = subprocess.Popen(cmdline, env=_e,
- startupinfo=startupinfo, shell=False)
+ proc = subprocess.Popen(cmdline, env=_e, shell=False)
except Exception as e:
print 'Error in calling:\n%s' % cmdline
print 'Exception: %s: %s' % (e, os.strerror(e.errno))
@@ -212,18 +209,23 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
LINKCOMSTR = 'LINK $TARGET'
)
+ # we need to seperate the variant_dir for BSPs and the kernels. BSPs could
+ # have their own components etc. If they point to the same folder, SCons
+ # would find the wrong source code to compile.
+ bsp_vdir = 'build/bsp'
+ kernel_vdir = 'build/kernel'
# board build script
- objs = SConscript('SConscript', variant_dir='build', duplicate=0)
- Repository(Rtt_Root)
+ objs = SConscript('SConscript', variant_dir=bsp_vdir, duplicate=0)
# include kernel
- objs.extend(SConscript(Rtt_Root + '/src/SConscript', variant_dir='build/src', duplicate=0))
+ objs.extend(SConscript(Rtt_Root + '/src/SConscript', variant_dir=kernel_vdir + '/src', duplicate=0))
# include libcpu
if not has_libcpu:
- objs.extend(SConscript(Rtt_Root + '/libcpu/SConscript', variant_dir='build/libcpu', duplicate=0))
+ objs.extend(SConscript(Rtt_Root + '/libcpu/SConscript',
+ variant_dir=kernel_vdir + '/libcpu', duplicate=0))
# include components
objs.extend(SConscript(Rtt_Root + '/components/SConscript',
- variant_dir='build/components',
+ variant_dir=kernel_vdir + '/components',
duplicate=0,
exports='remove_components'))
diff --git a/tools/keil.py b/tools/keil.py
index ef0dece3f8..64afedfb65 100644
--- a/tools/keil.py
+++ b/tools/keil.py
@@ -107,6 +107,7 @@ def MDK4Project(target, script):
groups = tree.find('Targets/Target/Groups')
if groups is None:
groups = SubElement(tree.find('Targets/Target'), 'Groups')
+ groups.clear() # clean old groups
for group in script:
group_xml = MDK4AddGroup(ProjectFiles, groups, group['name'], group['src'], project_path)
@@ -142,33 +143,20 @@ def MDK4Project(target, script):
if lib_path != '':
MDK4AddGroupForFN(ProjectFiles, groups, group['name'], lib_path, project_path)
- # remove repeat path
- paths = set()
- for path in CPPPATH:
- inc = _make_path_relative(project_path, os.path.normpath(path))
- paths.add(inc) #.replace('\\', '/')
-
- paths = [i for i in paths]
- paths.sort()
- CPPPATH = string.join(paths, ';')
-
- definitions = [i for i in set(CPPDEFINES)]
- CPPDEFINES = string.join(definitions, ', ')
-
# write include path, definitions and link flags
IncludePath = tree.find('Targets/Target/TargetOption/TargetArmAds/Cads/VariousControls/IncludePath')
- IncludePath.text = CPPPATH
-
+ IncludePath.text = ';'.join([_make_path_relative(project_path, os.path.normpath(i)) for i in CPPPATH])
+
Define = tree.find('Targets/Target/TargetOption/TargetArmAds/Cads/VariousControls/Define')
- Define.text = CPPDEFINES
+ Define.text = ', '.join(set(CPPDEFINES))
Misc = tree.find('Targets/Target/TargetOption/TargetArmAds/LDads/Misc')
Misc.text = LINKFLAGS
-
+
xml_indent(root)
out.write(etree.tostring(root, encoding='utf-8'))
out.close()
-
+
# copy uvopt file
if os.path.exists('template.uvopt'):
import shutil