From 6df6a7519aba12213dba8bad2d74cb7d237f4d60 Mon Sep 17 00:00:00 2001 From: SummerGift Date: Thu, 13 Dec 2018 15:05:48 +0800 Subject: [PATCH] [bsp][stm32] modify sconstruct --- .../libraries/templates/stm32f10x/SConstruct | 18 ++++++++++-------- .../libraries/templates/stm32f4xx/SConstruct | 17 ++++++++++------- .../libraries/templates/stm32l4xx/SConstruct | 19 +++++++++++-------- bsp/stm32/stm32f103-atk-nano/SConstruct | 18 ++++++++++-------- bsp/stm32/stm32f103-fire-arbitrary/SConstruct | 18 ++++++++++-------- bsp/stm32/stm32f407-atk-explorer/SConstruct | 17 ++++++++++------- bsp/stm32/stm32f429-atk-apollo/SConstruct | 17 ++++++++++------- .../stm32f429-fire-challenger/SConstruct | 17 ++++++++++------- 8 files changed, 81 insertions(+), 60 deletions(-) diff --git a/bsp/stm32/libraries/templates/stm32f10x/SConstruct b/bsp/stm32/libraries/templates/stm32f10x/SConstruct index 5514659688..c28354a99d 100644 --- a/bsp/stm32/libraries/templates/stm32f10x/SConstruct +++ b/bsp/stm32/libraries/templates/stm32f10x/SConstruct @@ -32,25 +32,27 @@ if rtconfig.PLATFORM == 'iar': Export('RTT_ROOT') Export('rtconfig') -# prepare building environment -objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) - SDK_ROOT = os.path.abspath('./') -bsp_vdir = 'build' if os.path.exists(SDK_ROOT + '/libraries'): - libraries_path_prefix = SDK_ROOT + '/libraries/' + libraries_path_prefix = SDK_ROOT + '/libraries' else: - libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/libraries/' + 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) stm32_library = 'STM32F1xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library # include libraries -objs.extend(SConscript(libraries_path_prefix + stm32_library + '/SConscript')) +objs.extend(SConscript(os.path.join(libraries_path_prefix, stm32_library, 'SConscript'))) # include drivers -objs.extend(SConscript(libraries_path_prefix + '/HAL_Drivers/SConscript')) +objs.extend(SConscript(os.path.join(libraries_path_prefix, 'HAL_Drivers', 'SConscript'))) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/libraries/templates/stm32f4xx/SConstruct b/bsp/stm32/libraries/templates/stm32f4xx/SConstruct index bcfdc31e22..c1609bf526 100644 --- a/bsp/stm32/libraries/templates/stm32f4xx/SConstruct +++ b/bsp/stm32/libraries/templates/stm32f4xx/SConstruct @@ -32,24 +32,27 @@ if rtconfig.PLATFORM == 'iar': Export('RTT_ROOT') Export('rtconfig') -# prepare building environment -objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) - SDK_ROOT = os.path.abspath('./') if os.path.exists(SDK_ROOT + '/libraries'): - libraries_path_prefix = SDK_ROOT + '/libraries/' + libraries_path_prefix = SDK_ROOT + '/libraries' else: - libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/libraries/' + 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) stm32_library = 'STM32F4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library # include libraries -objs.extend(SConscript(libraries_path_prefix + stm32_library + '/SConscript')) +objs.extend(SConscript(os.path.join(libraries_path_prefix, stm32_library, 'SConscript'))) # include drivers -objs.extend(SConscript(libraries_path_prefix + '/HAL_Drivers/SConscript')) +objs.extend(SConscript(os.path.join(libraries_path_prefix, 'HAL_Drivers', 'SConscript'))) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/libraries/templates/stm32l4xx/SConstruct b/bsp/stm32/libraries/templates/stm32l4xx/SConstruct index c8abfbd6ec..f28e552248 100644 --- a/bsp/stm32/libraries/templates/stm32l4xx/SConstruct +++ b/bsp/stm32/libraries/templates/stm32l4xx/SConstruct @@ -32,24 +32,27 @@ if rtconfig.PLATFORM == 'iar': Export('RTT_ROOT') Export('rtconfig') -# prepare building environment -objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) - SDK_ROOT = os.path.abspath('./') if os.path.exists(SDK_ROOT + '/libraries'): - libraries_path_prefix = SDK_ROOT + '/libraries/' + libraries_path_prefix = SDK_ROOT + '/libraries' else: - libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/libraries/' + libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/libraries' -stm32_library = 'STM32FL4xx_HAL' +SDK_LIB = libraries_path_prefix +Export('SDK_LIB') + +# prepare building environment +objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) + +stm32_library = 'STM32L4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library # include libraries -objs.extend(SConscript(libraries_path_prefix + stm32_library + '/SConscript')) +objs.extend(SConscript(os.path.join(libraries_path_prefix, stm32_library, 'SConscript'))) # include drivers -objs.extend(SConscript(libraries_path_prefix + '/HAL_Drivers/SConscript')) +objs.extend(SConscript(os.path.join(libraries_path_prefix, 'HAL_Drivers', 'SConscript'))) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f103-atk-nano/SConstruct b/bsp/stm32/stm32f103-atk-nano/SConstruct index 5514659688..c28354a99d 100644 --- a/bsp/stm32/stm32f103-atk-nano/SConstruct +++ b/bsp/stm32/stm32f103-atk-nano/SConstruct @@ -32,25 +32,27 @@ if rtconfig.PLATFORM == 'iar': Export('RTT_ROOT') Export('rtconfig') -# prepare building environment -objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) - SDK_ROOT = os.path.abspath('./') -bsp_vdir = 'build' if os.path.exists(SDK_ROOT + '/libraries'): - libraries_path_prefix = SDK_ROOT + '/libraries/' + libraries_path_prefix = SDK_ROOT + '/libraries' else: - libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/libraries/' + 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) stm32_library = 'STM32F1xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library # include libraries -objs.extend(SConscript(libraries_path_prefix + stm32_library + '/SConscript')) +objs.extend(SConscript(os.path.join(libraries_path_prefix, stm32_library, 'SConscript'))) # include drivers -objs.extend(SConscript(libraries_path_prefix + '/HAL_Drivers/SConscript')) +objs.extend(SConscript(os.path.join(libraries_path_prefix, 'HAL_Drivers', 'SConscript'))) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f103-fire-arbitrary/SConstruct b/bsp/stm32/stm32f103-fire-arbitrary/SConstruct index 5514659688..c28354a99d 100644 --- a/bsp/stm32/stm32f103-fire-arbitrary/SConstruct +++ b/bsp/stm32/stm32f103-fire-arbitrary/SConstruct @@ -32,25 +32,27 @@ if rtconfig.PLATFORM == 'iar': Export('RTT_ROOT') Export('rtconfig') -# prepare building environment -objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) - SDK_ROOT = os.path.abspath('./') -bsp_vdir = 'build' if os.path.exists(SDK_ROOT + '/libraries'): - libraries_path_prefix = SDK_ROOT + '/libraries/' + libraries_path_prefix = SDK_ROOT + '/libraries' else: - libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/libraries/' + 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) stm32_library = 'STM32F1xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library # include libraries -objs.extend(SConscript(libraries_path_prefix + stm32_library + '/SConscript')) +objs.extend(SConscript(os.path.join(libraries_path_prefix, stm32_library, 'SConscript'))) # include drivers -objs.extend(SConscript(libraries_path_prefix + '/HAL_Drivers/SConscript')) +objs.extend(SConscript(os.path.join(libraries_path_prefix, 'HAL_Drivers', 'SConscript'))) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f407-atk-explorer/SConstruct b/bsp/stm32/stm32f407-atk-explorer/SConstruct index bcfdc31e22..c1609bf526 100644 --- a/bsp/stm32/stm32f407-atk-explorer/SConstruct +++ b/bsp/stm32/stm32f407-atk-explorer/SConstruct @@ -32,24 +32,27 @@ if rtconfig.PLATFORM == 'iar': Export('RTT_ROOT') Export('rtconfig') -# prepare building environment -objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) - SDK_ROOT = os.path.abspath('./') if os.path.exists(SDK_ROOT + '/libraries'): - libraries_path_prefix = SDK_ROOT + '/libraries/' + libraries_path_prefix = SDK_ROOT + '/libraries' else: - libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/libraries/' + 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) stm32_library = 'STM32F4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library # include libraries -objs.extend(SConscript(libraries_path_prefix + stm32_library + '/SConscript')) +objs.extend(SConscript(os.path.join(libraries_path_prefix, stm32_library, 'SConscript'))) # include drivers -objs.extend(SConscript(libraries_path_prefix + '/HAL_Drivers/SConscript')) +objs.extend(SConscript(os.path.join(libraries_path_prefix, 'HAL_Drivers', 'SConscript'))) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f429-atk-apollo/SConstruct b/bsp/stm32/stm32f429-atk-apollo/SConstruct index bcfdc31e22..c1609bf526 100644 --- a/bsp/stm32/stm32f429-atk-apollo/SConstruct +++ b/bsp/stm32/stm32f429-atk-apollo/SConstruct @@ -32,24 +32,27 @@ if rtconfig.PLATFORM == 'iar': Export('RTT_ROOT') Export('rtconfig') -# prepare building environment -objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) - SDK_ROOT = os.path.abspath('./') if os.path.exists(SDK_ROOT + '/libraries'): - libraries_path_prefix = SDK_ROOT + '/libraries/' + libraries_path_prefix = SDK_ROOT + '/libraries' else: - libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/libraries/' + 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) stm32_library = 'STM32F4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library # include libraries -objs.extend(SConscript(libraries_path_prefix + stm32_library + '/SConscript')) +objs.extend(SConscript(os.path.join(libraries_path_prefix, stm32_library, 'SConscript'))) # include drivers -objs.extend(SConscript(libraries_path_prefix + '/HAL_Drivers/SConscript')) +objs.extend(SConscript(os.path.join(libraries_path_prefix, 'HAL_Drivers', 'SConscript'))) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f429-fire-challenger/SConstruct b/bsp/stm32/stm32f429-fire-challenger/SConstruct index bcfdc31e22..c1609bf526 100644 --- a/bsp/stm32/stm32f429-fire-challenger/SConstruct +++ b/bsp/stm32/stm32f429-fire-challenger/SConstruct @@ -32,24 +32,27 @@ if rtconfig.PLATFORM == 'iar': Export('RTT_ROOT') Export('rtconfig') -# prepare building environment -objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) - SDK_ROOT = os.path.abspath('./') if os.path.exists(SDK_ROOT + '/libraries'): - libraries_path_prefix = SDK_ROOT + '/libraries/' + libraries_path_prefix = SDK_ROOT + '/libraries' else: - libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/libraries/' + 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) stm32_library = 'STM32F4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library # include libraries -objs.extend(SConscript(libraries_path_prefix + stm32_library + '/SConscript')) +objs.extend(SConscript(os.path.join(libraries_path_prefix, stm32_library, 'SConscript'))) # include drivers -objs.extend(SConscript(libraries_path_prefix + '/HAL_Drivers/SConscript')) +objs.extend(SConscript(os.path.join(libraries_path_prefix, 'HAL_Drivers', 'SConscript'))) # make a building DoBuilding(TARGET, objs)