修复了imxrt1064-nxp-evk的BSP使用scons --dist生成的工程目录中没有libraries的问题
This commit is contained in:
parent
b2e30a7efe
commit
094d0b4fe3
|
@ -45,11 +45,26 @@ if rtconfig.PLATFORM == 'iar':
|
||||||
Export('RTT_ROOT')
|
Export('RTT_ROOT')
|
||||||
Export('rtconfig')
|
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
|
# prepare building environment
|
||||||
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
|
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
|
||||||
|
|
||||||
objs = objs + SConscript('../libraries/drivers/SConscript')
|
imxrt_library = 'MIMXRT1064'
|
||||||
objs = objs + SConscript('../libraries/MIMXRT1064/SConscript')
|
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
|
# make a building
|
||||||
DoBuilding(TARGET, objs)
|
DoBuilding(TARGET, objs)
|
||||||
|
|
|
@ -5,6 +5,9 @@ ARCH='arm'
|
||||||
CPU='cortex-m7'
|
CPU='cortex-m7'
|
||||||
CROSS_TOOL='gcc'
|
CROSS_TOOL='gcc'
|
||||||
|
|
||||||
|
# bsp lib config
|
||||||
|
BSP_LIBRARY_TYPE = None
|
||||||
|
|
||||||
if os.getenv('RTT_CC'):
|
if os.getenv('RTT_CC'):
|
||||||
CROSS_TOOL = os.getenv('RTT_CC')
|
CROSS_TOOL = os.getenv('RTT_CC')
|
||||||
if os.getenv('RTT_ROOT'):
|
if os.getenv('RTT_ROOT'):
|
||||||
|
@ -150,3 +153,10 @@ elif PLATFORM == 'iar':
|
||||||
|
|
||||||
EXEC_PATH = EXEC_PATH + '/arm/bin/'
|
EXEC_PATH = EXEC_PATH + '/arm/bin/'
|
||||||
POST_ACTION = 'ielftool --bin $TARGET rtthread.bin'
|
POST_ACTION = 'ielftool --bin $TARGET rtthread.bin'
|
||||||
|
|
||||||
|
def dist_handle(BSP_ROOT, dist_dir):
|
||||||
|
import sys
|
||||||
|
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, dist_dir)
|
||||||
|
|
|
@ -5,15 +5,16 @@ cwd_path = os.getcwd()
|
||||||
sys.path.append(os.path.join(os.path.dirname(cwd_path), 'rt-thread', 'tools'))
|
sys.path.append(os.path.join(os.path.dirname(cwd_path), 'rt-thread', 'tools'))
|
||||||
|
|
||||||
# BSP dist function
|
# BSP dist function
|
||||||
def dist_do_building(BSP_ROOT):
|
def dist_do_building(BSP_ROOT, dist_dir):
|
||||||
from mkdist import bsp_copy_files
|
from mkdist import bsp_copy_files
|
||||||
import rtconfig
|
import rtconfig
|
||||||
|
|
||||||
dist_dir = os.path.join(BSP_ROOT, 'dist', os.path.basename(BSP_ROOT))
|
print("=> copy imxrt bsp library")
|
||||||
library_path = os.path.join(os.path.dirname(BSP_ROOT), 'libraries')
|
library_path = os.path.join(os.path.dirname(BSP_ROOT), 'libraries')
|
||||||
library_dir = os.path.join(dist_dir, 'libraries')
|
library_dir = os.path.join(dist_dir, 'libraries')
|
||||||
|
bsp_copy_files(os.path.join(library_path, rtconfig.BSP_LIBRARY_TYPE),
|
||||||
|
os.path.join(library_dir, rtconfig.BSP_LIBRARY_TYPE))
|
||||||
|
|
||||||
print("=> copy bsp drivers")
|
print("=> copy bsp drivers")
|
||||||
bsp_copy_files(os.path.join(library_path, 'drivers'), os.path.join(library_dir, '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'))
|
shutil.copyfile(os.path.join(library_path, 'Kconfig'), os.path.join(library_dir, 'Kconfig'))
|
||||||
|
|
Loading…
Reference in New Issue