rt-thread/bsp/stm32/libraries/templates/stm32l4xx/board/SConscript

29 lines
977 B
Python
Raw Normal View History

2018-12-13 10:56:09 +08:00
import os
import rtconfig
from building import *
cwd = GetCurrentDir()
2018-12-13 10:56:09 +08:00
# add general drivers
src = Glob('board.c')
src += Glob('CubeMX_Config/Src/stm32l4xx_hal_msp.c')
2018-12-13 10:56:09 +08:00
path = [cwd]
path += [cwd + '/CubeMX_Config/Inc']
2018-12-13 10:56:09 +08:00
if os.path.exists(cwd + '/../libraries'):
startup_path_prefix = cwd + '/../libraries'
else:
startup_path_prefix = cwd + '/../../libraries'
if rtconfig.CROSS_TOOL == 'gcc':
2018-12-13 10:56:09 +08:00
src += [startup_path_prefix + '/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/startup_stm32l475xx.s']
elif rtconfig.CROSS_TOOL == 'keil':
2018-12-13 10:56:09 +08:00
src += [startup_path_prefix + '/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/arm/startup_stm32l475xx.s']
elif rtconfig.CROSS_TOOL == 'iar':
2018-12-13 10:56:09 +08:00
src += [startup_path_prefix + '/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/iar/startup_stm32l475xx.s']
CPPDEFINES = ['STM32L475xx']
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
Return('group')