mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-01-30 22:10:28 +08:00
Merge pull request #2086 from SummerGGift/dist_function
[tools][dist] optimize dist function
This commit is contained in:
commit
3e7c044013
@ -813,6 +813,9 @@ def EndBuilding(target, program = None):
|
|||||||
if hasattr(rtconfig, 'BSP_LIBRARY_TYPE'):
|
if hasattr(rtconfig, 'BSP_LIBRARY_TYPE'):
|
||||||
Env['bsp_lib_type'] = 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)
|
Env.AddPostAction(target, rtconfig.POST_ACTION)
|
||||||
# Add addition clean files
|
# Add addition clean files
|
||||||
Clean(target, 'cconfig.h')
|
Clean(target, 'cconfig.h')
|
||||||
|
@ -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']))
|
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'))
|
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
|
# get all source files from program
|
||||||
for item in program:
|
for item in program:
|
||||||
walk_children(item)
|
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, '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']))
|
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'))
|
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
|
# copy tools directory
|
||||||
print('=> components')
|
print('=> components')
|
||||||
do_copy_folder(os.path.join(RTT_ROOT, 'components'), os.path.join(target_path, 'components'))
|
do_copy_folder(os.path.join(RTT_ROOT, 'components'), os.path.join(target_path, 'components'))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user