修正了dist命令对imxrt系列bsp包的支持,修改前的dist命令生成的工程缺少了Libraries。
This commit is contained in:
parent
8f4b4bdbcd
commit
8ee8328ab0
|
@ -45,11 +45,27 @@ if rtconfig.PLATFORM == 'iar':
|
|||
Export('RTT_ROOT')
|
||||
Export('rtconfig')
|
||||
|
||||
SDK_ROOT = os.path.abspath('./')
|
||||
|
||||
if os.path.exists(SDK_ROOT + '/Libraries'):
|
||||
libraries_path_prefix = SDK_ROOT + '/Libraries'
|
||||
else:
|
||||
libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/Libraries'
|
||||
|
||||
SDK_LIB = libraries_path_prefix
|
||||
Export('SDK_LIB')
|
||||
|
||||
# prepare building environment
|
||||
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
|
||||
|
||||
objs = objs + SConscript('../Libraries/drivers/SConscript')
|
||||
objs = objs + SConscript('../Libraries/MIMXRT1050/SConscript')
|
||||
imxrt_library = 'MIMXRT1050'
|
||||
rtconfig.BSP_LIBRARY_TYPE = imxrt_library
|
||||
|
||||
# include libraries
|
||||
objs.extend(SConscript(os.path.join(libraries_path_prefix, imxrt_library, 'SConscript')))
|
||||
|
||||
# include drivers
|
||||
objs.extend(SConscript(os.path.join(libraries_path_prefix, 'drivers', 'SConscript')))
|
||||
|
||||
# make a building
|
||||
DoBuilding(TARGET, objs)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import os
|
||||
import sys
|
||||
|
||||
# toolchains options
|
||||
ARCH='arm'
|
||||
|
@ -147,3 +148,10 @@ elif PLATFORM == 'iar':
|
|||
|
||||
EXEC_PATH = EXEC_PATH + '/arm/bin/'
|
||||
POST_ACTION = 'ielftool --bin $TARGET rtthread.bin'
|
||||
|
||||
def dist_handle(BSP_ROOT):
|
||||
cwd_path = os.getcwd()
|
||||
sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools'))
|
||||
from sdk_dist import dist_do_building
|
||||
dist_do_building(BSP_ROOT)
|
||||
|
|
@ -45,11 +45,27 @@ if rtconfig.PLATFORM == 'iar':
|
|||
Export('RTT_ROOT')
|
||||
Export('rtconfig')
|
||||
|
||||
SDK_ROOT = os.path.abspath('./')
|
||||
|
||||
if os.path.exists(SDK_ROOT + '/Libraries'):
|
||||
libraries_path_prefix = SDK_ROOT + '/Libraries'
|
||||
else:
|
||||
libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/Libraries'
|
||||
|
||||
SDK_LIB = libraries_path_prefix
|
||||
Export('SDK_LIB')
|
||||
|
||||
# prepare building environment
|
||||
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
|
||||
|
||||
objs = objs + SConscript('../Libraries/drivers/SConscript')
|
||||
objs = objs + SConscript('../Libraries/MIMXRT1050/SConscript')
|
||||
imxrt_library = 'MIMXRT1050'
|
||||
rtconfig.BSP_LIBRARY_TYPE = imxrt_library
|
||||
|
||||
# include libraries
|
||||
objs.extend(SConscript(os.path.join(libraries_path_prefix, imxrt_library, 'SConscript')))
|
||||
|
||||
# include drivers
|
||||
objs.extend(SConscript(os.path.join(libraries_path_prefix, 'drivers', 'SConscript')))
|
||||
|
||||
# make a building
|
||||
DoBuilding(TARGET, objs)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import os
|
||||
import sys
|
||||
|
||||
# toolchains options
|
||||
ARCH='arm'
|
||||
|
@ -147,3 +148,10 @@ elif PLATFORM == 'iar':
|
|||
|
||||
EXEC_PATH = EXEC_PATH + '/arm/bin/'
|
||||
POST_ACTION = 'ielftool --bin $TARGET rtthread.bin'
|
||||
|
||||
def dist_handle(BSP_ROOT):
|
||||
cwd_path = os.getcwd()
|
||||
sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools'))
|
||||
from sdk_dist import dist_do_building
|
||||
dist_do_building(BSP_ROOT)
|
||||
|
|
@ -45,11 +45,27 @@ if rtconfig.PLATFORM == 'iar':
|
|||
Export('RTT_ROOT')
|
||||
Export('rtconfig')
|
||||
|
||||
SDK_ROOT = os.path.abspath('./')
|
||||
|
||||
if os.path.exists(SDK_ROOT + '/Libraries'):
|
||||
libraries_path_prefix = SDK_ROOT + '/Libraries'
|
||||
else:
|
||||
libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/Libraries'
|
||||
|
||||
SDK_LIB = libraries_path_prefix
|
||||
Export('SDK_LIB')
|
||||
|
||||
# prepare building environment
|
||||
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
|
||||
|
||||
objs = objs + SConscript('../Libraries/drivers/SConscript')
|
||||
objs = objs + SConscript('../Libraries/MIMXRT1050/SConscript')
|
||||
imxrt_library = 'MIMXRT1050'
|
||||
rtconfig.BSP_LIBRARY_TYPE = imxrt_library
|
||||
|
||||
# include libraries
|
||||
objs.extend(SConscript(os.path.join(libraries_path_prefix, imxrt_library, 'SConscript')))
|
||||
|
||||
# include drivers
|
||||
objs.extend(SConscript(os.path.join(libraries_path_prefix, 'drivers', 'SConscript')))
|
||||
|
||||
# make a building
|
||||
DoBuilding(TARGET, objs)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import os
|
||||
import sys
|
||||
|
||||
# toolchains options
|
||||
ARCH='arm'
|
||||
|
@ -147,3 +148,10 @@ elif PLATFORM == 'iar':
|
|||
|
||||
EXEC_PATH = EXEC_PATH + '/arm/bin/'
|
||||
POST_ACTION = 'ielftool --bin $TARGET rtthread.bin'
|
||||
|
||||
def dist_handle(BSP_ROOT):
|
||||
cwd_path = os.getcwd()
|
||||
sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools'))
|
||||
from sdk_dist import dist_do_building
|
||||
dist_do_building(BSP_ROOT)
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
import os
|
||||
import sys
|
||||
import shutil
|
||||
cwd_path = os.getcwd()
|
||||
sys.path.append(os.path.join(os.path.dirname(cwd_path), 'rt-thread', 'tools'))
|
||||
|
||||
# BSP dist function
|
||||
def dist_do_building(BSP_ROOT):
|
||||
from mkdist import bsp_copy_files
|
||||
import rtconfig
|
||||
|
||||
dist_dir = os.path.join(BSP_ROOT, 'dist', os.path.basename(BSP_ROOT))
|
||||
library_path = os.path.join(os.path.dirname(BSP_ROOT), 'Libraries')
|
||||
library_dir = os.path.join(dist_dir, 'Libraries')
|
||||
print("=> copy bsp drivers")
|
||||
bsp_copy_files(os.path.join(library_path, 'drivers'), os.path.join(library_dir, 'drivers'))
|
||||
print("=> copy bsp library")
|
||||
bsp_copy_files(os.path.join(library_path, rtconfig.BSP_LIBRARY_TYPE), os.path.join(library_dir, rtconfig.BSP_LIBRARY_TYPE))
|
||||
shutil.copyfile(os.path.join(library_path, 'Kconfig'), os.path.join(library_dir, 'Kconfig'))
|
Loading…
Reference in New Issue