summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSummerGift <[email protected]>2018-12-17 18:46:48 +0800
committerSummerGift <[email protected]>2018-12-18 13:37:59 +0800
commitcb6f9021354a67e24fc0e0a51cb2fee022e95231 (patch)
tree556a9471a7e42d065b0dc6e365e6deab028dc090 /tools
parent9e990be5729ba4d4514ba997708ca0b70b147a36 (diff)
[tools][dist] optimize stm32 bsp dist function
Diffstat (limited to 'tools')
-rw-r--r--tools/building.py3
-rw-r--r--tools/mkdist.py14
2 files changed, 16 insertions, 1 deletions
diff --git a/tools/building.py b/tools/building.py
index eb2da2fab9..90c1c871b6 100644
--- a/tools/building.py
+++ b/tools/building.py
@@ -813,6 +813,9 @@ def EndBuilding(target, program = None):
if hasattr(rtconfig, 'BSP_LIBRARY_TYPE'):
Env['bsp_lib_type'] = rtconfig.BSP_LIBRARY_TYPE
+ if hasattr(rtconfig, 'dist_handle'):
+ Env['dist_handle'] = rtconfig.dist_handle
+
Env.AddPostAction(target, rtconfig.POST_ACTION)
# Add addition clean files
Clean(target, 'cconfig.h')
diff --git a/tools/mkdist.py b/tools/mkdist.py
index e927417fc4..cf30e95284 100644
--- a/tools/mkdist.py
+++ b/tools/mkdist.py
@@ -196,6 +196,12 @@ def MkDist_Strip(program, BSP_ROOT, RTT_ROOT, Env):
bsp_copy_files(os.path.join(library_path, Env['bsp_lib_type']), os.path.join(library_dir, Env['bsp_lib_type']))
shutil.copyfile(os.path.join(library_path, 'Kconfig'), os.path.join(library_dir, 'Kconfig'))
+ # do bsp special dist handle
+ if 'dist_handle' in Env:
+ print("=> start dist handle")
+ dist_handle = Env['dist_handle']
+ dist_handle(BSP_ROOT)
+
# get all source files from program
for item in program:
walk_children(item)
@@ -316,7 +322,13 @@ def MkDist(program, BSP_ROOT, RTT_ROOT, Env):
bsp_copy_files(os.path.join(library_path, 'HAL_Drivers'), os.path.join(library_dir, 'HAL_Drivers'))
bsp_copy_files(os.path.join(library_path, Env['bsp_lib_type']), os.path.join(library_dir, Env['bsp_lib_type']))
shutil.copyfile(os.path.join(library_path, 'Kconfig'), os.path.join(library_dir, 'Kconfig'))
-
+
+ # do bsp special dist handle
+ if 'dist_handle' in Env:
+ print("=> start dist handle")
+ dist_handle = Env['dist_handle']
+ dist_handle(BSP_ROOT)
+
# copy tools directory
print('=> components')
do_copy_folder(os.path.join(RTT_ROOT, 'components'), os.path.join(target_path, 'components'))