提交 37554e72 编写于 作者: G guozhanxin

[build] improve build output.

上级 ce602a6e
...@@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): ...@@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'):
else: else:
libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/libraries' libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/libraries'
from utils import _make_path_relative
libraries_path_prefix = _make_path_relative(os.path.abspath('./'), libraries_path_prefix)
SDK_LIB = libraries_path_prefix SDK_LIB = libraries_path_prefix
Export('SDK_LIB') Export('SDK_LIB')
...@@ -50,13 +53,18 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) ...@@ -50,13 +53,18 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
stm32_library = 'STM32L4xx_HAL' stm32_library = 'STM32L4xx_HAL'
rtconfig.BSP_LIBRARY_TYPE = stm32_library rtconfig.BSP_LIBRARY_TYPE = stm32_library
bsp_vdir = 'build'
# include libraries # include libraries
objs.extend(SConscript(os.path.join(libraries_path_prefix, stm32_library, 'SConscript'))) objs.extend(SConscript(os.path.join(libraries_path_prefix, stm32_library, 'SConscript'),
variant_dir=bsp_vdir + '/libraries/'+ stm32_library, duplicate=0))
# include drivers # include drivers
objs.extend(SConscript(os.path.join(libraries_path_prefix, 'HAL_Drivers', 'SConscript'))) objs.extend(SConscript(os.path.join(libraries_path_prefix, 'HAL_Drivers', 'SConscript'),
variant_dir=bsp_vdir + '/libraries/HAL_Drivers', duplicate=0))
objs.extend(SConscript(os.path.join(os.getcwd(), 'board', 'ports', 'SConscript'))) objs.extend(SConscript(os.path.join(os.getcwd(), 'board', 'ports', 'SConscript'),
variant_dir=bsp_vdir + '/board/ports', duplicate=0))
# make a building # make a building
DoBuilding(TARGET, objs) DoBuilding(TARGET, objs)
...@@ -39,17 +39,17 @@ path += [cwd + '/CubeMX_Config/Inc'] ...@@ -39,17 +39,17 @@ path += [cwd + '/CubeMX_Config/Inc']
if GetDepend(['BSP_USING_AUDIO']): if GetDepend(['BSP_USING_AUDIO']):
path += [cwd + '/ports/audio'] path += [cwd + '/ports/audio']
startup_path_prefix = SDK_LIB startup_path_prefix = SDK_LIB
if rtconfig.CROSS_TOOL == 'gcc': if rtconfig.CROSS_TOOL == 'gcc':
src += [startup_path_prefix + '/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/startup_stm32l475xx.s'] src_startup = [startup_path_prefix + '/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/startup_stm32l475xx.s']
elif rtconfig.CROSS_TOOL == 'keil': elif rtconfig.CROSS_TOOL == 'keil':
src += [startup_path_prefix + '/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/arm/startup_stm32l475xx.s'] src_startup = [startup_path_prefix + '/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/arm/startup_stm32l475xx.s']
elif rtconfig.CROSS_TOOL == 'iar': elif rtconfig.CROSS_TOOL == 'iar':
src += [startup_path_prefix + '/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/iar/startup_stm32l475xx.s'] src_startup= [startup_path_prefix + '/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/iar/startup_stm32l475xx.s']
CPPDEFINES = ['STM32L475xx'] CPPDEFINES = ['STM32L475xx']
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) + DefineGroup('Libraries', src = src_startup, depend = [''])
Return('group') Return('group')
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册