From 921247b4203c4621a67739861b078f608cc73ce3 Mon Sep 17 00:00:00 2001 From: guozhanxin Date: Tue, 29 Mar 2022 23:15:45 +0800 Subject: [PATCH 1/3] [bsp/stm32] improve build output. --- .../libraries/templates/stm32f0xx/SConstruct | 15 ++++++++++++-- .../libraries/templates/stm32f10x/SConstruct | 15 ++++++++++++-- .../libraries/templates/stm32f2xx/SConstruct | 15 ++++++++++++-- .../libraries/templates/stm32f3xx/SConstruct | 15 ++++++++++++-- .../libraries/templates/stm32f4xx/SConstruct | 15 ++++++++++++-- .../libraries/templates/stm32f7xx/SConstruct | 15 ++++++++++++-- .../libraries/templates/stm32h7xx/SConstruct | 17 +++++++++++++--- .../libraries/templates/stm32l1xx/SConstruct | 15 ++++++++++++-- .../libraries/templates/stm32l4xx/SConstruct | 15 ++++++++++++-- .../libraries/templates/stm32l5xx/SConstruct | 15 ++++++++++++-- .../libraries/templates/stm32mp1xx/SConstruct | 15 ++++++++++++-- .../libraries/templates/stm32wbxx/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32f072-st-nucleo/SConstruct | 17 +++++++++++++--- bsp/stm32/stm32f091-st-nucleo/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32f103-atk-nano/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32f103-atk-warshipv3/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32f103-blue-pill/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32f103-dofly-M3S/SConstruct | 19 ++++++++++++++---- bsp/stm32/stm32f103-dofly-lyc8/SConstruct | 17 +++++++++++++--- bsp/stm32/stm32f103-fire-arbitrary/SConstruct | 15 ++++++++++++-- .../stm32f103-gizwits-gokitv21/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32f103-hw100k-ibox/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32f103-onenet-nbiot/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32f103-yf-ufun/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32f107-uc-eval/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32f207-st-nucleo/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32f302-st-nucleo/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32f401-st-nucleo/SConstruct | 15 ++++++++++++-- .../stm32f405-smdz-breadfruit/SConstruct | 17 +++++++++++++--- bsp/stm32/stm32f407-armfly-v5/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32f407-atk-explorer/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32f407-robomaster-c/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32f407-st-discovery/SConstruct | 19 ++++++++++++++---- bsp/stm32/stm32f410-st-nucleo/SConstruct | 19 ++++++++++++++---- bsp/stm32/stm32f411-atk-nano/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32f411-st-nucleo/SConstruct | 19 ++++++++++++++---- bsp/stm32/stm32f411-weact-MiniF4/SConstruct | 19 ++++++++++++++---- bsp/stm32/stm32f412-st-nucleo/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32f413-st-nucleo/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32f427-robomaster-a/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32f429-armfly-v6/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32f429-atk-apollo/SConstruct | 15 ++++++++++++-- .../stm32f429-fire-challenger/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32f429-st-disco/SConstruct | 19 ++++++++++++++---- bsp/stm32/stm32f446-st-nucleo/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32f469-st-disco/SConstruct | 20 +++++++++++++------ bsp/stm32/stm32f746-st-disco/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32f746-st-nucleo/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32f767-atk-apollo/SConstruct | 15 ++++++++++++-- .../stm32f767-fire-challenger-v1/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32f767-st-nucleo/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32f769-st-disco/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32g070-st-nucleo/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32g071-st-nucleo/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32g431-st-nucleo/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32g474-st-nucleo/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32h743-armfly-V7/SConstruct | 17 +++++++++++++--- bsp/stm32/stm32h743-atk-apollo/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32h743-openmv-h7plus/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32h743-st-nucleo/SConstruct | 17 +++++++++++++--- bsp/stm32/stm32h747-st-discovery/SConstruct | 17 +++++++++++++--- bsp/stm32/stm32h750-armfly-h7-tool/SConstruct | 17 +++++++++++++--- bsp/stm32/stm32h750-artpi-h750/SConstruct | 17 +++++++++++++--- bsp/stm32/stm32l010-st-nucleo/SConstruct | 17 +++++++++++++--- bsp/stm32/stm32l053-st-nucleo/SConstruct | 17 +++++++++++++--- bsp/stm32/stm32l412-st-nucleo/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32l431-BearPi/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32l432-st-nucleo/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32l433-ali-startkit/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32l433-st-nucleo/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32l452-st-nucleo/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32l475-atk-pandora/SConstruct | 15 +++++++++++--- .../stm32l475-atk-pandora/board/SConscript | 7 ++++--- bsp/stm32/stm32l475-st-discovery/SConstruct | 19 ++++++++++++++---- bsp/stm32/stm32l476-st-nucleo/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32l496-ali-developer/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32l496-st-nucleo/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32l4r5-st-nucleo/SConstruct | 16 +++++++++++++-- bsp/stm32/stm32l4r9-st-eval/SConstruct | 19 ++++++++++++++---- .../stm32l4r9-st-sensortile-box/SConstruct | 19 ++++++++++++++---- bsp/stm32/stm32l552-st-nucleo/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32mp157a-st-discovery/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32mp157a-st-ev1/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32u575-st-nucleo/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32wb55-st-nucleo/SConstruct | 15 ++++++++++++-- bsp/stm32/stm32wl55-st-nucleo/SConstruct | 16 +++++++++++++-- .../stm32wle5-yizhilian-lm401/SConstruct | 16 +++++++++++++-- 87 files changed, 1154 insertions(+), 209 deletions(-) diff --git a/bsp/stm32/libraries/templates/stm32f0xx/SConstruct b/bsp/stm32/libraries/templates/stm32f0xx/SConstruct index 277821b12c..faae7eeed3 100644 --- a/bsp/stm32/libraries/templates/stm32f0xx/SConstruct +++ b/bsp/stm32/libraries/templates/stm32f0xx/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F0xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/libraries/templates/stm32f10x/SConstruct b/bsp/stm32/libraries/templates/stm32f10x/SConstruct index e636260b5a..8be268bf1c 100644 --- a/bsp/stm32/libraries/templates/stm32f10x/SConstruct +++ b/bsp/stm32/libraries/templates/stm32f10x/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F1xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/libraries/templates/stm32f2xx/SConstruct b/bsp/stm32/libraries/templates/stm32f2xx/SConstruct index 3b4403a7e4..9c8aaca2fe 100644 --- a/bsp/stm32/libraries/templates/stm32f2xx/SConstruct +++ b/bsp/stm32/libraries/templates/stm32f2xx/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F2xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/libraries/templates/stm32f3xx/SConstruct b/bsp/stm32/libraries/templates/stm32f3xx/SConstruct index dfef5be14f..217a62a04a 100644 --- a/bsp/stm32/libraries/templates/stm32f3xx/SConstruct +++ b/bsp/stm32/libraries/templates/stm32f3xx/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F3xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/libraries/templates/stm32f4xx/SConstruct b/bsp/stm32/libraries/templates/stm32f4xx/SConstruct index fe44ee0b8a..2e6891d41f 100644 --- a/bsp/stm32/libraries/templates/stm32f4xx/SConstruct +++ b/bsp/stm32/libraries/templates/stm32f4xx/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/libraries/templates/stm32f7xx/SConstruct b/bsp/stm32/libraries/templates/stm32f7xx/SConstruct index 1e20ca63a7..7839929ee3 100644 --- a/bsp/stm32/libraries/templates/stm32f7xx/SConstruct +++ b/bsp/stm32/libraries/templates/stm32f7xx/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F7xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/libraries/templates/stm32h7xx/SConstruct b/bsp/stm32/libraries/templates/stm32h7xx/SConstruct index fc6658ebc7..5f37aeca01 100644 --- a/bsp/stm32/libraries/templates/stm32h7xx/SConstruct +++ b/bsp/stm32/libraries/templates/stm32h7xx/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32H7xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library -# include drivers -objs.extend(SConscript(os.path.join(libraries_path_prefix, stm32_library, 'SConscript'))) +bsp_vdir = 'build' # include libraries -objs.extend(SConscript(os.path.join(libraries_path_prefix, 'HAL_Drivers', 'SConscript'))) +objs.extend(SConscript(os.path.join(libraries_path_prefix, stm32_library, 'SConscript'), + variant_dir=bsp_vdir + '/libraries/'+ stm32_library, duplicate=0)) + +# include drivers +objs.extend(SConscript(os.path.join(libraries_path_prefix, 'HAL_Drivers', 'SConscript'), + variant_dir=bsp_vdir + '/libraries/HAL_Drivers', duplicate=0)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/libraries/templates/stm32l1xx/SConstruct b/bsp/stm32/libraries/templates/stm32l1xx/SConstruct index 13ca54bdb9..344c69af3a 100644 --- a/bsp/stm32/libraries/templates/stm32l1xx/SConstruct +++ b/bsp/stm32/libraries/templates/stm32l1xx/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32L1xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/libraries/templates/stm32l4xx/SConstruct b/bsp/stm32/libraries/templates/stm32l4xx/SConstruct index 57568a7bdf..a47cac3b41 100644 --- a/bsp/stm32/libraries/templates/stm32l4xx/SConstruct +++ b/bsp/stm32/libraries/templates/stm32l4xx/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32L4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/libraries/templates/stm32l5xx/SConstruct b/bsp/stm32/libraries/templates/stm32l5xx/SConstruct index 6d1acee40b..f527df6696 100644 --- a/bsp/stm32/libraries/templates/stm32l5xx/SConstruct +++ b/bsp/stm32/libraries/templates/stm32l5xx/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32L5xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/libraries/templates/stm32mp1xx/SConstruct b/bsp/stm32/libraries/templates/stm32mp1xx/SConstruct index e75b162f9d..389edc6086 100644 --- a/bsp/stm32/libraries/templates/stm32mp1xx/SConstruct +++ b/bsp/stm32/libraries/templates/stm32mp1xx/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32MPxx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/libraries/templates/stm32wbxx/SConstruct b/bsp/stm32/libraries/templates/stm32wbxx/SConstruct index 6aeca83d9f..fbed954790 100644 --- a/bsp/stm32/libraries/templates/stm32wbxx/SConstruct +++ b/bsp/stm32/libraries/templates/stm32wbxx/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32WBxx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f072-st-nucleo/SConstruct b/bsp/stm32/stm32f072-st-nucleo/SConstruct index 1df044209c..faae7eeed3 100644 --- a/bsp/stm32/stm32f072-st-nucleo/SConstruct +++ b/bsp/stm32/stm32f072-st-nucleo/SConstruct @@ -15,7 +15,7 @@ except: print(RTT_ROOT) exit(-1) -TARGET = 'rt-thread_acm32f030.' + rtconfig.TARGET_EXT +TARGET = 'rt-thread.' + rtconfig.TARGET_EXT DefaultEnvironment(tools=[]) env = Environment(tools = ['mingw'], @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F0xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f091-st-nucleo/SConstruct b/bsp/stm32/stm32f091-st-nucleo/SConstruct index 277821b12c..faae7eeed3 100644 --- a/bsp/stm32/stm32f091-st-nucleo/SConstruct +++ b/bsp/stm32/stm32f091-st-nucleo/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F0xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f103-atk-nano/SConstruct b/bsp/stm32/stm32f103-atk-nano/SConstruct index e636260b5a..8be268bf1c 100644 --- a/bsp/stm32/stm32f103-atk-nano/SConstruct +++ b/bsp/stm32/stm32f103-atk-nano/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F1xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f103-atk-warshipv3/SConstruct b/bsp/stm32/stm32f103-atk-warshipv3/SConstruct index e636260b5a..8be268bf1c 100644 --- a/bsp/stm32/stm32f103-atk-warshipv3/SConstruct +++ b/bsp/stm32/stm32f103-atk-warshipv3/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F1xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f103-blue-pill/SConstruct b/bsp/stm32/stm32f103-blue-pill/SConstruct index e636260b5a..8be268bf1c 100644 --- a/bsp/stm32/stm32f103-blue-pill/SConstruct +++ b/bsp/stm32/stm32f103-blue-pill/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F1xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f103-dofly-M3S/SConstruct b/bsp/stm32/stm32f103-dofly-M3S/SConstruct index 541fddf58a..8be268bf1c 100644 --- a/bsp/stm32/stm32f103-dofly-M3S/SConstruct +++ b/bsp/stm32/stm32f103-dofly-M3S/SConstruct @@ -15,7 +15,7 @@ except: print(RTT_ROOT) exit(-1) -TARGET = 'rtthread.' + rtconfig.TARGET_EXT +TARGET = 'rt-thread.' + rtconfig.TARGET_EXT DefaultEnvironment(tools=[]) env = Environment(tools = ['mingw'], @@ -29,7 +29,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = env["LINKCOM"] + ' --map rtthread.map') + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F1xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f103-dofly-lyc8/SConstruct b/bsp/stm32/stm32f103-dofly-lyc8/SConstruct index 2a46bcc92c..8be268bf1c 100644 --- a/bsp/stm32/stm32f103-dofly-lyc8/SConstruct +++ b/bsp/stm32/stm32f103-dofly-lyc8/SConstruct @@ -29,7 +29,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map rt-thread.map']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F1xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f103-fire-arbitrary/SConstruct b/bsp/stm32/stm32f103-fire-arbitrary/SConstruct index e636260b5a..8be268bf1c 100644 --- a/bsp/stm32/stm32f103-fire-arbitrary/SConstruct +++ b/bsp/stm32/stm32f103-fire-arbitrary/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F1xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f103-gizwits-gokitv21/SConstruct b/bsp/stm32/stm32f103-gizwits-gokitv21/SConstruct index e636260b5a..8be268bf1c 100644 --- a/bsp/stm32/stm32f103-gizwits-gokitv21/SConstruct +++ b/bsp/stm32/stm32f103-gizwits-gokitv21/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F1xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f103-hw100k-ibox/SConstruct b/bsp/stm32/stm32f103-hw100k-ibox/SConstruct index e636260b5a..8be268bf1c 100644 --- a/bsp/stm32/stm32f103-hw100k-ibox/SConstruct +++ b/bsp/stm32/stm32f103-hw100k-ibox/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F1xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f103-onenet-nbiot/SConstruct b/bsp/stm32/stm32f103-onenet-nbiot/SConstruct index e636260b5a..8be268bf1c 100644 --- a/bsp/stm32/stm32f103-onenet-nbiot/SConstruct +++ b/bsp/stm32/stm32f103-onenet-nbiot/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F1xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f103-yf-ufun/SConstruct b/bsp/stm32/stm32f103-yf-ufun/SConstruct index e636260b5a..8be268bf1c 100644 --- a/bsp/stm32/stm32f103-yf-ufun/SConstruct +++ b/bsp/stm32/stm32f103-yf-ufun/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F1xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f107-uc-eval/SConstruct b/bsp/stm32/stm32f107-uc-eval/SConstruct index e636260b5a..8be268bf1c 100644 --- a/bsp/stm32/stm32f107-uc-eval/SConstruct +++ b/bsp/stm32/stm32f107-uc-eval/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F1xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f207-st-nucleo/SConstruct b/bsp/stm32/stm32f207-st-nucleo/SConstruct index 3b4403a7e4..9c8aaca2fe 100644 --- a/bsp/stm32/stm32f207-st-nucleo/SConstruct +++ b/bsp/stm32/stm32f207-st-nucleo/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F2xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f302-st-nucleo/SConstruct b/bsp/stm32/stm32f302-st-nucleo/SConstruct index dfef5be14f..217a62a04a 100644 --- a/bsp/stm32/stm32f302-st-nucleo/SConstruct +++ b/bsp/stm32/stm32f302-st-nucleo/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F3xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f401-st-nucleo/SConstruct b/bsp/stm32/stm32f401-st-nucleo/SConstruct index fe44ee0b8a..2e6891d41f 100644 --- a/bsp/stm32/stm32f401-st-nucleo/SConstruct +++ b/bsp/stm32/stm32f401-st-nucleo/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f405-smdz-breadfruit/SConstruct b/bsp/stm32/stm32f405-smdz-breadfruit/SConstruct index 761a4751f2..2e6891d41f 100644 --- a/bsp/stm32/stm32f405-smdz-breadfruit/SConstruct +++ b/bsp/stm32/stm32f405-smdz-breadfruit/SConstruct @@ -29,7 +29,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = env["LINKCOM"] + ' --map rtthread.map') + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f407-armfly-v5/SConstruct b/bsp/stm32/stm32f407-armfly-v5/SConstruct index fe44ee0b8a..2e6891d41f 100644 --- a/bsp/stm32/stm32f407-armfly-v5/SConstruct +++ b/bsp/stm32/stm32f407-armfly-v5/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f407-atk-explorer/SConstruct b/bsp/stm32/stm32f407-atk-explorer/SConstruct index fe44ee0b8a..2e6891d41f 100644 --- a/bsp/stm32/stm32f407-atk-explorer/SConstruct +++ b/bsp/stm32/stm32f407-atk-explorer/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f407-robomaster-c/SConstruct b/bsp/stm32/stm32f407-robomaster-c/SConstruct index fe44ee0b8a..2e6891d41f 100644 --- a/bsp/stm32/stm32f407-robomaster-c/SConstruct +++ b/bsp/stm32/stm32f407-robomaster-c/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f407-st-discovery/SConstruct b/bsp/stm32/stm32f407-st-discovery/SConstruct index a021b1b3e3..2e6891d41f 100644 --- a/bsp/stm32/stm32f407-st-discovery/SConstruct +++ b/bsp/stm32/stm32f407-st-discovery/SConstruct @@ -15,7 +15,7 @@ except: print(RTT_ROOT) exit(-1) -TARGET = 'rtthread.' + rtconfig.TARGET_EXT +TARGET = 'rt-thread.' + rtconfig.TARGET_EXT DefaultEnvironment(tools=[]) env = Environment(tools = ['mingw'], @@ -29,7 +29,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = env["LINKCOM"] + ' --map rtthread.map') + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f410-st-nucleo/SConstruct b/bsp/stm32/stm32f410-st-nucleo/SConstruct index a021b1b3e3..2e6891d41f 100644 --- a/bsp/stm32/stm32f410-st-nucleo/SConstruct +++ b/bsp/stm32/stm32f410-st-nucleo/SConstruct @@ -15,7 +15,7 @@ except: print(RTT_ROOT) exit(-1) -TARGET = 'rtthread.' + rtconfig.TARGET_EXT +TARGET = 'rt-thread.' + rtconfig.TARGET_EXT DefaultEnvironment(tools=[]) env = Environment(tools = ['mingw'], @@ -29,7 +29,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = env["LINKCOM"] + ' --map rtthread.map') + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f411-atk-nano/SConstruct b/bsp/stm32/stm32f411-atk-nano/SConstruct index fe44ee0b8a..2e6891d41f 100644 --- a/bsp/stm32/stm32f411-atk-nano/SConstruct +++ b/bsp/stm32/stm32f411-atk-nano/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f411-st-nucleo/SConstruct b/bsp/stm32/stm32f411-st-nucleo/SConstruct index a021b1b3e3..2e6891d41f 100644 --- a/bsp/stm32/stm32f411-st-nucleo/SConstruct +++ b/bsp/stm32/stm32f411-st-nucleo/SConstruct @@ -15,7 +15,7 @@ except: print(RTT_ROOT) exit(-1) -TARGET = 'rtthread.' + rtconfig.TARGET_EXT +TARGET = 'rt-thread.' + rtconfig.TARGET_EXT DefaultEnvironment(tools=[]) env = Environment(tools = ['mingw'], @@ -29,7 +29,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = env["LINKCOM"] + ' --map rtthread.map') + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f411-weact-MiniF4/SConstruct b/bsp/stm32/stm32f411-weact-MiniF4/SConstruct index a021b1b3e3..2e6891d41f 100644 --- a/bsp/stm32/stm32f411-weact-MiniF4/SConstruct +++ b/bsp/stm32/stm32f411-weact-MiniF4/SConstruct @@ -15,7 +15,7 @@ except: print(RTT_ROOT) exit(-1) -TARGET = 'rtthread.' + rtconfig.TARGET_EXT +TARGET = 'rt-thread.' + rtconfig.TARGET_EXT DefaultEnvironment(tools=[]) env = Environment(tools = ['mingw'], @@ -29,7 +29,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = env["LINKCOM"] + ' --map rtthread.map') + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f412-st-nucleo/SConstruct b/bsp/stm32/stm32f412-st-nucleo/SConstruct index fe44ee0b8a..2e6891d41f 100644 --- a/bsp/stm32/stm32f412-st-nucleo/SConstruct +++ b/bsp/stm32/stm32f412-st-nucleo/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f413-st-nucleo/SConstruct b/bsp/stm32/stm32f413-st-nucleo/SConstruct index fe44ee0b8a..2e6891d41f 100644 --- a/bsp/stm32/stm32f413-st-nucleo/SConstruct +++ b/bsp/stm32/stm32f413-st-nucleo/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f427-robomaster-a/SConstruct b/bsp/stm32/stm32f427-robomaster-a/SConstruct index fe44ee0b8a..2e6891d41f 100644 --- a/bsp/stm32/stm32f427-robomaster-a/SConstruct +++ b/bsp/stm32/stm32f427-robomaster-a/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f429-armfly-v6/SConstruct b/bsp/stm32/stm32f429-armfly-v6/SConstruct index fe44ee0b8a..2e6891d41f 100644 --- a/bsp/stm32/stm32f429-armfly-v6/SConstruct +++ b/bsp/stm32/stm32f429-armfly-v6/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f429-atk-apollo/SConstruct b/bsp/stm32/stm32f429-atk-apollo/SConstruct index fe44ee0b8a..2e6891d41f 100644 --- a/bsp/stm32/stm32f429-atk-apollo/SConstruct +++ b/bsp/stm32/stm32f429-atk-apollo/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f429-fire-challenger/SConstruct b/bsp/stm32/stm32f429-fire-challenger/SConstruct index fe44ee0b8a..2e6891d41f 100644 --- a/bsp/stm32/stm32f429-fire-challenger/SConstruct +++ b/bsp/stm32/stm32f429-fire-challenger/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f429-st-disco/SConstruct b/bsp/stm32/stm32f429-st-disco/SConstruct index a021b1b3e3..2e6891d41f 100644 --- a/bsp/stm32/stm32f429-st-disco/SConstruct +++ b/bsp/stm32/stm32f429-st-disco/SConstruct @@ -15,7 +15,7 @@ except: print(RTT_ROOT) exit(-1) -TARGET = 'rtthread.' + rtconfig.TARGET_EXT +TARGET = 'rt-thread.' + rtconfig.TARGET_EXT DefaultEnvironment(tools=[]) env = Environment(tools = ['mingw'], @@ -29,7 +29,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = env["LINKCOM"] + ' --map rtthread.map') + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f446-st-nucleo/SConstruct b/bsp/stm32/stm32f446-st-nucleo/SConstruct index fe44ee0b8a..2e6891d41f 100644 --- a/bsp/stm32/stm32f446-st-nucleo/SConstruct +++ b/bsp/stm32/stm32f446-st-nucleo/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f469-st-disco/SConstruct b/bsp/stm32/stm32f469-st-disco/SConstruct index f401eae23b..2e6891d41f 100644 --- a/bsp/stm32/stm32f469-st-disco/SConstruct +++ b/bsp/stm32/stm32f469-st-disco/SConstruct @@ -15,7 +15,7 @@ except: print(RTT_ROOT) exit(-1) -TARGET = 'rtthread.' + rtconfig.TARGET_EXT +TARGET = 'rt-thread.' + rtconfig.TARGET_EXT DefaultEnvironment(tools=[]) env = Environment(tools = ['mingw'], @@ -29,7 +29,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = env["LINKCOM"] + ' --map rtthread.map') + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,14 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) -# include ports -objs.extend(SConscript(os.path.join(os.getcwd(), 'board', 'ports', 'SConscript'))) +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f746-st-disco/SConstruct b/bsp/stm32/stm32f746-st-disco/SConstruct index 1e20ca63a7..7839929ee3 100644 --- a/bsp/stm32/stm32f746-st-disco/SConstruct +++ b/bsp/stm32/stm32f746-st-disco/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F7xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f746-st-nucleo/SConstruct b/bsp/stm32/stm32f746-st-nucleo/SConstruct index 1e20ca63a7..7839929ee3 100644 --- a/bsp/stm32/stm32f746-st-nucleo/SConstruct +++ b/bsp/stm32/stm32f746-st-nucleo/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F7xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f767-atk-apollo/SConstruct b/bsp/stm32/stm32f767-atk-apollo/SConstruct index 1e20ca63a7..7839929ee3 100644 --- a/bsp/stm32/stm32f767-atk-apollo/SConstruct +++ b/bsp/stm32/stm32f767-atk-apollo/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F7xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f767-fire-challenger-v1/SConstruct b/bsp/stm32/stm32f767-fire-challenger-v1/SConstruct index 1e20ca63a7..7839929ee3 100644 --- a/bsp/stm32/stm32f767-fire-challenger-v1/SConstruct +++ b/bsp/stm32/stm32f767-fire-challenger-v1/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F7xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f767-st-nucleo/SConstruct b/bsp/stm32/stm32f767-st-nucleo/SConstruct index 1e20ca63a7..7839929ee3 100644 --- a/bsp/stm32/stm32f767-st-nucleo/SConstruct +++ b/bsp/stm32/stm32f767-st-nucleo/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F7xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32f769-st-disco/SConstruct b/bsp/stm32/stm32f769-st-disco/SConstruct index 1e20ca63a7..7839929ee3 100644 --- a/bsp/stm32/stm32f769-st-disco/SConstruct +++ b/bsp/stm32/stm32f769-st-disco/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32F7xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32g070-st-nucleo/SConstruct b/bsp/stm32/stm32g070-st-nucleo/SConstruct index a52778f267..1c2797fb67 100644 --- a/bsp/stm32/stm32g070-st-nucleo/SConstruct +++ b/bsp/stm32/stm32g070-st-nucleo/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32G0xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32g071-st-nucleo/SConstruct b/bsp/stm32/stm32g071-st-nucleo/SConstruct index a52778f267..1c2797fb67 100644 --- a/bsp/stm32/stm32g071-st-nucleo/SConstruct +++ b/bsp/stm32/stm32g071-st-nucleo/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32G0xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32g431-st-nucleo/SConstruct b/bsp/stm32/stm32g431-st-nucleo/SConstruct index eea15e2828..3b7b4bf07e 100644 --- a/bsp/stm32/stm32g431-st-nucleo/SConstruct +++ b/bsp/stm32/stm32g431-st-nucleo/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32G4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32g474-st-nucleo/SConstruct b/bsp/stm32/stm32g474-st-nucleo/SConstruct index eea15e2828..3b7b4bf07e 100644 --- a/bsp/stm32/stm32g474-st-nucleo/SConstruct +++ b/bsp/stm32/stm32g474-st-nucleo/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32G4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32h743-armfly-V7/SConstruct b/bsp/stm32/stm32h743-armfly-V7/SConstruct index fc6658ebc7..5f37aeca01 100644 --- a/bsp/stm32/stm32h743-armfly-V7/SConstruct +++ b/bsp/stm32/stm32h743-armfly-V7/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32H7xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library -# include drivers -objs.extend(SConscript(os.path.join(libraries_path_prefix, stm32_library, 'SConscript'))) +bsp_vdir = 'build' # include libraries -objs.extend(SConscript(os.path.join(libraries_path_prefix, 'HAL_Drivers', 'SConscript'))) +objs.extend(SConscript(os.path.join(libraries_path_prefix, stm32_library, 'SConscript'), + variant_dir=bsp_vdir + '/libraries/'+ stm32_library, duplicate=0)) + +# include drivers +objs.extend(SConscript(os.path.join(libraries_path_prefix, 'HAL_Drivers', 'SConscript'), + variant_dir=bsp_vdir + '/libraries/HAL_Drivers', duplicate=0)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32h743-atk-apollo/SConstruct b/bsp/stm32/stm32h743-atk-apollo/SConstruct index 7adb1878ab..5f37aeca01 100644 --- a/bsp/stm32/stm32h743-atk-apollo/SConstruct +++ b/bsp/stm32/stm32h743-atk-apollo/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32H7xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32h743-openmv-h7plus/SConstruct b/bsp/stm32/stm32h743-openmv-h7plus/SConstruct index 7adb1878ab..5f37aeca01 100644 --- a/bsp/stm32/stm32h743-openmv-h7plus/SConstruct +++ b/bsp/stm32/stm32h743-openmv-h7plus/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32H7xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32h743-st-nucleo/SConstruct b/bsp/stm32/stm32h743-st-nucleo/SConstruct index fc6658ebc7..5f37aeca01 100644 --- a/bsp/stm32/stm32h743-st-nucleo/SConstruct +++ b/bsp/stm32/stm32h743-st-nucleo/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32H7xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library -# include drivers -objs.extend(SConscript(os.path.join(libraries_path_prefix, stm32_library, 'SConscript'))) +bsp_vdir = 'build' # include libraries -objs.extend(SConscript(os.path.join(libraries_path_prefix, 'HAL_Drivers', 'SConscript'))) +objs.extend(SConscript(os.path.join(libraries_path_prefix, stm32_library, 'SConscript'), + variant_dir=bsp_vdir + '/libraries/'+ stm32_library, duplicate=0)) + +# include drivers +objs.extend(SConscript(os.path.join(libraries_path_prefix, 'HAL_Drivers', 'SConscript'), + variant_dir=bsp_vdir + '/libraries/HAL_Drivers', duplicate=0)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32h747-st-discovery/SConstruct b/bsp/stm32/stm32h747-st-discovery/SConstruct index fc6658ebc7..5f37aeca01 100644 --- a/bsp/stm32/stm32h747-st-discovery/SConstruct +++ b/bsp/stm32/stm32h747-st-discovery/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32H7xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library -# include drivers -objs.extend(SConscript(os.path.join(libraries_path_prefix, stm32_library, 'SConscript'))) +bsp_vdir = 'build' # include libraries -objs.extend(SConscript(os.path.join(libraries_path_prefix, 'HAL_Drivers', 'SConscript'))) +objs.extend(SConscript(os.path.join(libraries_path_prefix, stm32_library, 'SConscript'), + variant_dir=bsp_vdir + '/libraries/'+ stm32_library, duplicate=0)) + +# include drivers +objs.extend(SConscript(os.path.join(libraries_path_prefix, 'HAL_Drivers', 'SConscript'), + variant_dir=bsp_vdir + '/libraries/HAL_Drivers', duplicate=0)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32h750-armfly-h7-tool/SConstruct b/bsp/stm32/stm32h750-armfly-h7-tool/SConstruct index fc6658ebc7..5f37aeca01 100644 --- a/bsp/stm32/stm32h750-armfly-h7-tool/SConstruct +++ b/bsp/stm32/stm32h750-armfly-h7-tool/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32H7xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library -# include drivers -objs.extend(SConscript(os.path.join(libraries_path_prefix, stm32_library, 'SConscript'))) +bsp_vdir = 'build' # include libraries -objs.extend(SConscript(os.path.join(libraries_path_prefix, 'HAL_Drivers', 'SConscript'))) +objs.extend(SConscript(os.path.join(libraries_path_prefix, stm32_library, 'SConscript'), + variant_dir=bsp_vdir + '/libraries/'+ stm32_library, duplicate=0)) + +# include drivers +objs.extend(SConscript(os.path.join(libraries_path_prefix, 'HAL_Drivers', 'SConscript'), + variant_dir=bsp_vdir + '/libraries/HAL_Drivers', duplicate=0)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32h750-artpi-h750/SConstruct b/bsp/stm32/stm32h750-artpi-h750/SConstruct index fc6658ebc7..5f37aeca01 100644 --- a/bsp/stm32/stm32h750-artpi-h750/SConstruct +++ b/bsp/stm32/stm32h750-artpi-h750/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32H7xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library -# include drivers -objs.extend(SConscript(os.path.join(libraries_path_prefix, stm32_library, 'SConscript'))) +bsp_vdir = 'build' # include libraries -objs.extend(SConscript(os.path.join(libraries_path_prefix, 'HAL_Drivers', 'SConscript'))) +objs.extend(SConscript(os.path.join(libraries_path_prefix, stm32_library, 'SConscript'), + variant_dir=bsp_vdir + '/libraries/'+ stm32_library, duplicate=0)) + +# include drivers +objs.extend(SConscript(os.path.join(libraries_path_prefix, 'HAL_Drivers', 'SConscript'), + variant_dir=bsp_vdir + '/libraries/HAL_Drivers', duplicate=0)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32l010-st-nucleo/SConstruct b/bsp/stm32/stm32l010-st-nucleo/SConstruct index dd9870f2ca..a47cac3b41 100644 --- a/bsp/stm32/stm32l010-st-nucleo/SConstruct +++ b/bsp/stm32/stm32l010-st-nucleo/SConstruct @@ -41,20 +41,31 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') # prepare building environment objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) -stm32_library = 'STM32L0xx_HAL' +stm32_library = 'STM32L4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32l053-st-nucleo/SConstruct b/bsp/stm32/stm32l053-st-nucleo/SConstruct index dd9870f2ca..a47cac3b41 100644 --- a/bsp/stm32/stm32l053-st-nucleo/SConstruct +++ b/bsp/stm32/stm32l053-st-nucleo/SConstruct @@ -41,20 +41,31 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') # prepare building environment objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) -stm32_library = 'STM32L0xx_HAL' +stm32_library = 'STM32L4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32l412-st-nucleo/SConstruct b/bsp/stm32/stm32l412-st-nucleo/SConstruct index 57568a7bdf..a47cac3b41 100644 --- a/bsp/stm32/stm32l412-st-nucleo/SConstruct +++ b/bsp/stm32/stm32l412-st-nucleo/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32L4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32l431-BearPi/SConstruct b/bsp/stm32/stm32l431-BearPi/SConstruct index 57568a7bdf..a47cac3b41 100644 --- a/bsp/stm32/stm32l431-BearPi/SConstruct +++ b/bsp/stm32/stm32l431-BearPi/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32L4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32l432-st-nucleo/SConstruct b/bsp/stm32/stm32l432-st-nucleo/SConstruct index 57568a7bdf..a47cac3b41 100644 --- a/bsp/stm32/stm32l432-st-nucleo/SConstruct +++ b/bsp/stm32/stm32l432-st-nucleo/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32L4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32l433-ali-startkit/SConstruct b/bsp/stm32/stm32l433-ali-startkit/SConstruct index 57568a7bdf..a47cac3b41 100644 --- a/bsp/stm32/stm32l433-ali-startkit/SConstruct +++ b/bsp/stm32/stm32l433-ali-startkit/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32L4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32l433-st-nucleo/SConstruct b/bsp/stm32/stm32l433-st-nucleo/SConstruct index 57568a7bdf..a47cac3b41 100644 --- a/bsp/stm32/stm32l433-st-nucleo/SConstruct +++ b/bsp/stm32/stm32l433-st-nucleo/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32L4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32l452-st-nucleo/SConstruct b/bsp/stm32/stm32l452-st-nucleo/SConstruct index 57568a7bdf..a47cac3b41 100644 --- a/bsp/stm32/stm32l452-st-nucleo/SConstruct +++ b/bsp/stm32/stm32l452-st-nucleo/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32L4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32l475-atk-pandora/SConstruct b/bsp/stm32/stm32l475-atk-pandora/SConstruct index dcd7ae2889..a47cac3b41 100644 --- a/bsp/stm32/stm32l475-atk-pandora/SConstruct +++ b/bsp/stm32/stm32l475-atk-pandora/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,13 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32L4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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'))) +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32l475-atk-pandora/board/SConscript b/bsp/stm32/stm32l475-atk-pandora/board/SConscript index 29efa41d65..bff91b7deb 100644 --- a/bsp/stm32/stm32l475-atk-pandora/board/SConscript +++ b/bsp/stm32/stm32l475-atk-pandora/board/SConscript @@ -17,7 +17,7 @@ if GetDepend(['BSP_USING_KEY']): if GetDepend(['BSP_USING_QSPI_FLASH']): src += Glob('ports/drv_qspi_flash.c') - + if GetDepend(['BSP_USING_SDCARD']): src += Glob('ports/drv_sdcard.c') @@ -39,7 +39,7 @@ path += [cwd + '/CubeMX_Config/Inc'] if GetDepend(['BSP_USING_AUDIO']): path += [cwd + '/ports/audio'] - + startup_path_prefix = SDK_LIB if rtconfig.CROSS_TOOL == 'gcc': @@ -49,7 +49,8 @@ elif rtconfig.CROSS_TOOL == 'keil': elif rtconfig.CROSS_TOOL == 'iar': src += [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) Return('group') + diff --git a/bsp/stm32/stm32l475-st-discovery/SConstruct b/bsp/stm32/stm32l475-st-discovery/SConstruct index 6aa0397a60..a47cac3b41 100644 --- a/bsp/stm32/stm32l475-st-discovery/SConstruct +++ b/bsp/stm32/stm32l475-st-discovery/SConstruct @@ -15,7 +15,7 @@ except: print(RTT_ROOT) exit(-1) -TARGET = 'rtthread.' + rtconfig.TARGET_EXT +TARGET = 'rt-thread.' + rtconfig.TARGET_EXT DefaultEnvironment(tools=[]) env = Environment(tools = ['mingw'], @@ -29,7 +29,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = env["LINKCOM"] + ' --map rtthread.map') + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32L4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32l476-st-nucleo/SConstruct b/bsp/stm32/stm32l476-st-nucleo/SConstruct index 57568a7bdf..a47cac3b41 100644 --- a/bsp/stm32/stm32l476-st-nucleo/SConstruct +++ b/bsp/stm32/stm32l476-st-nucleo/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32L4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32l496-ali-developer/SConstruct b/bsp/stm32/stm32l496-ali-developer/SConstruct index 57568a7bdf..a47cac3b41 100644 --- a/bsp/stm32/stm32l496-ali-developer/SConstruct +++ b/bsp/stm32/stm32l496-ali-developer/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32L4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32l496-st-nucleo/SConstruct b/bsp/stm32/stm32l496-st-nucleo/SConstruct index 57568a7bdf..a47cac3b41 100644 --- a/bsp/stm32/stm32l496-st-nucleo/SConstruct +++ b/bsp/stm32/stm32l496-st-nucleo/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32L4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32l4r5-st-nucleo/SConstruct b/bsp/stm32/stm32l4r5-st-nucleo/SConstruct index b67bee1d00..a47cac3b41 100644 --- a/bsp/stm32/stm32l4r5-st-nucleo/SConstruct +++ b/bsp/stm32/stm32l4r5-st-nucleo/SConstruct @@ -17,6 +17,7 @@ except: TARGET = 'rt-thread.' + rtconfig.TARGET_EXT +DefaultEnvironment(tools=[]) env = Environment(tools = ['mingw'], AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS, @@ -40,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -49,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32L4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32l4r9-st-eval/SConstruct b/bsp/stm32/stm32l4r9-st-eval/SConstruct index 6aa0397a60..a47cac3b41 100644 --- a/bsp/stm32/stm32l4r9-st-eval/SConstruct +++ b/bsp/stm32/stm32l4r9-st-eval/SConstruct @@ -15,7 +15,7 @@ except: print(RTT_ROOT) exit(-1) -TARGET = 'rtthread.' + rtconfig.TARGET_EXT +TARGET = 'rt-thread.' + rtconfig.TARGET_EXT DefaultEnvironment(tools=[]) env = Environment(tools = ['mingw'], @@ -29,7 +29,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = env["LINKCOM"] + ' --map rtthread.map') + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32L4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32l4r9-st-sensortile-box/SConstruct b/bsp/stm32/stm32l4r9-st-sensortile-box/SConstruct index 6aa0397a60..a47cac3b41 100644 --- a/bsp/stm32/stm32l4r9-st-sensortile-box/SConstruct +++ b/bsp/stm32/stm32l4r9-st-sensortile-box/SConstruct @@ -15,7 +15,7 @@ except: print(RTT_ROOT) exit(-1) -TARGET = 'rtthread.' + rtconfig.TARGET_EXT +TARGET = 'rt-thread.' + rtconfig.TARGET_EXT DefaultEnvironment(tools=[]) env = Environment(tools = ['mingw'], @@ -29,7 +29,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = env["LINKCOM"] + ' --map rtthread.map') + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32L4xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32l552-st-nucleo/SConstruct b/bsp/stm32/stm32l552-st-nucleo/SConstruct index 6d1acee40b..f527df6696 100644 --- a/bsp/stm32/stm32l552-st-nucleo/SConstruct +++ b/bsp/stm32/stm32l552-st-nucleo/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32L5xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32mp157a-st-discovery/SConstruct b/bsp/stm32/stm32mp157a-st-discovery/SConstruct index e75b162f9d..389edc6086 100644 --- a/bsp/stm32/stm32mp157a-st-discovery/SConstruct +++ b/bsp/stm32/stm32mp157a-st-discovery/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32MPxx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32mp157a-st-ev1/SConstruct b/bsp/stm32/stm32mp157a-st-ev1/SConstruct index e75b162f9d..389edc6086 100644 --- a/bsp/stm32/stm32mp157a-st-ev1/SConstruct +++ b/bsp/stm32/stm32mp157a-st-ev1/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32MPxx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32u575-st-nucleo/SConstruct b/bsp/stm32/stm32u575-st-nucleo/SConstruct index 5d52030247..76705c5c95 100644 --- a/bsp/stm32/stm32u575-st-nucleo/SConstruct +++ b/bsp/stm32/stm32u575-st-nucleo/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32U5xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32wb55-st-nucleo/SConstruct b/bsp/stm32/stm32wb55-st-nucleo/SConstruct index 6aeca83d9f..fbed954790 100644 --- a/bsp/stm32/stm32wb55-st-nucleo/SConstruct +++ b/bsp/stm32/stm32wb55-st-nucleo/SConstruct @@ -41,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -50,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32WBxx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32wl55-st-nucleo/SConstruct b/bsp/stm32/stm32wl55-st-nucleo/SConstruct index f3769ce5b6..0ba7f251a0 100644 --- a/bsp/stm32/stm32wl55-st-nucleo/SConstruct +++ b/bsp/stm32/stm32wl55-st-nucleo/SConstruct @@ -17,6 +17,7 @@ except: TARGET = 'rt-thread.' + rtconfig.TARGET_EXT +DefaultEnvironment(tools=[]) env = Environment(tools = ['mingw'], AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS, @@ -40,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -49,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32WLxx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/stm32/stm32wle5-yizhilian-lm401/SConstruct b/bsp/stm32/stm32wle5-yizhilian-lm401/SConstruct index f3769ce5b6..0ba7f251a0 100644 --- a/bsp/stm32/stm32wle5-yizhilian-lm401/SConstruct +++ b/bsp/stm32/stm32wle5-yizhilian-lm401/SConstruct @@ -17,6 +17,7 @@ except: TARGET = 'rt-thread.' + rtconfig.TARGET_EXT +DefaultEnvironment(tools=[]) env = Environment(tools = ['mingw'], AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS, @@ -40,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -49,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) stm32_library = 'STM32WLxx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library +bsp_vdir = 'build' + # 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 -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)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) From 1b6031954ac80a973c485d84ba3d0d2aef2bd110 Mon Sep 17 00:00:00 2001 From: guozhanxin Date: Wed, 30 Mar 2022 01:21:43 +0800 Subject: [PATCH 2/3] [bsp/imxrt] improve build output. --- bsp/imxrt/imxrt1052-atk-commander/SConstruct | 44 +++++++------- bsp/imxrt/imxrt1052-fire-pro/SConstruct | 44 +++++++------- bsp/imxrt/imxrt1052-nxp-evk/SConstruct | 45 +++++++------- bsp/imxrt/imxrt1052-seeed-ArchMix/SConstruct | 44 +++++++------- bsp/imxrt/imxrt1060-nxp-evk/SConstruct | 46 +++++++------- bsp/imxrt/imxrt1064-nxp-evk/SConstruct | 46 +++++++------- .../templates/imxrt1050xxx/SConstruct | 60 ++++++++++++------- .../templates/imxrt1064xxx/SConstruct | 60 ++++++++++++------- 8 files changed, 207 insertions(+), 182 deletions(-) diff --git a/bsp/imxrt/imxrt1052-atk-commander/SConstruct b/bsp/imxrt/imxrt1052-atk-commander/SConstruct index 55ebf9d391..e371dfb926 100644 --- a/bsp/imxrt/imxrt1052-atk-commander/SConstruct +++ b/bsp/imxrt/imxrt1052-atk-commander/SConstruct @@ -15,32 +15,21 @@ except: print(RTT_ROOT) exit(-1) -TARGET = 'rtthread.' + rtconfig.TARGET_EXT -DefaultEnvironment(tools=[]) -if rtconfig.PLATFORM == 'armcc': - env = Environment(tools = ['mingw'], - AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, - CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS, - CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS, - AR = rtconfig.AR, ARFLAGS = '-rc', - LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS, - # overwrite cflags, because cflags has '--C99' - CXXCOM = '$CXX -o $TARGET --cpp -c $CXXFLAGS $_CCCOMCOM $SOURCES') -else: - env = Environment(tools = ['mingw'], - AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, - CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS, - CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS, - AR = rtconfig.AR, ARFLAGS = '-rc', - LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS, - CXXCOM = '$CXX -o $TARGET -c $CXXFLAGS $_CCCOMCOM $SOURCES') +TARGET = 'rt-thread.' + rtconfig.TARGET_EXT +DefaultEnvironment(tools=[]) +env = Environment(tools = ['mingw'], + AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, + CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS, + AR = rtconfig.AR, ARFLAGS = '-rc', + CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS, + LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS) env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = env["LINKCOM"] + ' --map rtthread.map') + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') @@ -52,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -61,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) imxrt_library = 'MIMXRT1050' rtconfig.BSP_LIBRARY_TYPE = imxrt_library +bsp_vdir = 'build' + # include libraries -objs.extend(SConscript(os.path.join(libraries_path_prefix, imxrt_library, 'SConscript'))) +objs.extend(SConscript(os.path.join(libraries_path_prefix, imxrt_library, 'SConscript'), + variant_dir=bsp_vdir + '/libraries/'+ imxrt_library, duplicate=0)) # include drivers -objs.extend(SConscript(os.path.join(libraries_path_prefix, 'drivers', 'SConscript'))) +objs.extend(SConscript(os.path.join(libraries_path_prefix, 'drivers', 'SConscript'), + variant_dir=bsp_vdir + '/libraries/drivers', duplicate=0)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/imxrt/imxrt1052-fire-pro/SConstruct b/bsp/imxrt/imxrt1052-fire-pro/SConstruct index 55ebf9d391..e371dfb926 100644 --- a/bsp/imxrt/imxrt1052-fire-pro/SConstruct +++ b/bsp/imxrt/imxrt1052-fire-pro/SConstruct @@ -15,32 +15,21 @@ except: print(RTT_ROOT) exit(-1) -TARGET = 'rtthread.' + rtconfig.TARGET_EXT -DefaultEnvironment(tools=[]) -if rtconfig.PLATFORM == 'armcc': - env = Environment(tools = ['mingw'], - AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, - CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS, - CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS, - AR = rtconfig.AR, ARFLAGS = '-rc', - LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS, - # overwrite cflags, because cflags has '--C99' - CXXCOM = '$CXX -o $TARGET --cpp -c $CXXFLAGS $_CCCOMCOM $SOURCES') -else: - env = Environment(tools = ['mingw'], - AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, - CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS, - CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS, - AR = rtconfig.AR, ARFLAGS = '-rc', - LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS, - CXXCOM = '$CXX -o $TARGET -c $CXXFLAGS $_CCCOMCOM $SOURCES') +TARGET = 'rt-thread.' + rtconfig.TARGET_EXT +DefaultEnvironment(tools=[]) +env = Environment(tools = ['mingw'], + AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, + CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS, + AR = rtconfig.AR, ARFLAGS = '-rc', + CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS, + LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS) env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = env["LINKCOM"] + ' --map rtthread.map') + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') @@ -52,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -61,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) imxrt_library = 'MIMXRT1050' rtconfig.BSP_LIBRARY_TYPE = imxrt_library +bsp_vdir = 'build' + # include libraries -objs.extend(SConscript(os.path.join(libraries_path_prefix, imxrt_library, 'SConscript'))) +objs.extend(SConscript(os.path.join(libraries_path_prefix, imxrt_library, 'SConscript'), + variant_dir=bsp_vdir + '/libraries/'+ imxrt_library, duplicate=0)) # include drivers -objs.extend(SConscript(os.path.join(libraries_path_prefix, 'drivers', 'SConscript'))) +objs.extend(SConscript(os.path.join(libraries_path_prefix, 'drivers', 'SConscript'), + variant_dir=bsp_vdir + '/libraries/drivers', duplicate=0)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/imxrt/imxrt1052-nxp-evk/SConstruct b/bsp/imxrt/imxrt1052-nxp-evk/SConstruct index 42b12299a3..e371dfb926 100644 --- a/bsp/imxrt/imxrt1052-nxp-evk/SConstruct +++ b/bsp/imxrt/imxrt1052-nxp-evk/SConstruct @@ -15,32 +15,21 @@ except: print(RTT_ROOT) exit(-1) -TARGET = 'rtthread.' + rtconfig.TARGET_EXT -DefaultEnvironment(tools=[]) -if rtconfig.PLATFORM == 'armcc': - env = Environment(tools = ['mingw'], - AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, - CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS, - CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS, - AR = rtconfig.AR, ARFLAGS = '-rc', - LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS, - # overwrite cflags, because cflags has '--C99' - CXXCOM = '$CXX -o $TARGET --cpp -c $CXXFLAGS $_CCCOMCOM $SOURCES') -else: - env = Environment(tools = ['mingw'], - AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, - CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS, - CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS, - AR = rtconfig.AR, ARFLAGS = '-rc', - LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS, - CXXCOM = '$CXX -o $TARGET -c $CXXFLAGS $_CCCOMCOM $SOURCES') +TARGET = 'rt-thread.' + rtconfig.TARGET_EXT +DefaultEnvironment(tools=[]) +env = Environment(tools = ['mingw'], + AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, + CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS, + AR = rtconfig.AR, ARFLAGS = '-rc', + CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS, + LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS) env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = env["LINKCOM"] + ' --map rtthread.map') + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') @@ -52,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -61,14 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) imxrt_library = 'MIMXRT1050' rtconfig.BSP_LIBRARY_TYPE = imxrt_library +bsp_vdir = 'build' + # include libraries -objs.extend(SConscript(os.path.join(libraries_path_prefix, imxrt_library, 'SConscript'))) +objs.extend(SConscript(os.path.join(libraries_path_prefix, imxrt_library, 'SConscript'), + variant_dir=bsp_vdir + '/libraries/'+ imxrt_library, duplicate=0)) # include drivers -objs.extend(SConscript(os.path.join(libraries_path_prefix, 'drivers', 'SConscript'))) +objs.extend(SConscript(os.path.join(libraries_path_prefix, 'drivers', 'SConscript'), + variant_dir=bsp_vdir + '/libraries/drivers', duplicate=0)) -# include peripherals -objs.extend(SConscript(os.path.join(libraries_path_prefix, 'peripherals', 'SConscript'))) +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/imxrt/imxrt1052-seeed-ArchMix/SConstruct b/bsp/imxrt/imxrt1052-seeed-ArchMix/SConstruct index 55ebf9d391..e371dfb926 100644 --- a/bsp/imxrt/imxrt1052-seeed-ArchMix/SConstruct +++ b/bsp/imxrt/imxrt1052-seeed-ArchMix/SConstruct @@ -15,32 +15,21 @@ except: print(RTT_ROOT) exit(-1) -TARGET = 'rtthread.' + rtconfig.TARGET_EXT -DefaultEnvironment(tools=[]) -if rtconfig.PLATFORM == 'armcc': - env = Environment(tools = ['mingw'], - AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, - CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS, - CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS, - AR = rtconfig.AR, ARFLAGS = '-rc', - LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS, - # overwrite cflags, because cflags has '--C99' - CXXCOM = '$CXX -o $TARGET --cpp -c $CXXFLAGS $_CCCOMCOM $SOURCES') -else: - env = Environment(tools = ['mingw'], - AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, - CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS, - CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS, - AR = rtconfig.AR, ARFLAGS = '-rc', - LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS, - CXXCOM = '$CXX -o $TARGET -c $CXXFLAGS $_CCCOMCOM $SOURCES') +TARGET = 'rt-thread.' + rtconfig.TARGET_EXT +DefaultEnvironment(tools=[]) +env = Environment(tools = ['mingw'], + AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, + CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS, + AR = rtconfig.AR, ARFLAGS = '-rc', + CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS, + LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS) env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = env["LINKCOM"] + ' --map rtthread.map') + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') @@ -52,6 +41,9 @@ if os.path.exists(SDK_ROOT + '/libraries'): else: 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 Export('SDK_LIB') @@ -61,11 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) imxrt_library = 'MIMXRT1050' rtconfig.BSP_LIBRARY_TYPE = imxrt_library +bsp_vdir = 'build' + # include libraries -objs.extend(SConscript(os.path.join(libraries_path_prefix, imxrt_library, 'SConscript'))) +objs.extend(SConscript(os.path.join(libraries_path_prefix, imxrt_library, 'SConscript'), + variant_dir=bsp_vdir + '/libraries/'+ imxrt_library, duplicate=0)) # include drivers -objs.extend(SConscript(os.path.join(libraries_path_prefix, 'drivers', 'SConscript'))) +objs.extend(SConscript(os.path.join(libraries_path_prefix, 'drivers', 'SConscript'), + variant_dir=bsp_vdir + '/libraries/drivers', duplicate=0)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/imxrt/imxrt1060-nxp-evk/SConstruct b/bsp/imxrt/imxrt1060-nxp-evk/SConstruct index b9be046c72..edbca1c148 100644 --- a/bsp/imxrt/imxrt1060-nxp-evk/SConstruct +++ b/bsp/imxrt/imxrt1060-nxp-evk/SConstruct @@ -15,42 +15,35 @@ except: print(RTT_ROOT) exit(-1) -TARGET = 'rtthread.' + rtconfig.TARGET_EXT -DefaultEnvironment(tools=[]) -if rtconfig.PLATFORM == 'armcc': - env = Environment(tools = ['mingw'], - AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, - CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS, - CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS, - AR = rtconfig.AR, ARFLAGS = '-rc', - LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS, - # overwrite cflags, because cflags has '--C99' - CXXCOM = '$CXX -o $TARGET --cpp -c $CXXFLAGS $_CCCOMCOM $SOURCES') -else: - env = Environment(tools = ['mingw'], - AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, - CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS, - CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS, - AR = rtconfig.AR, ARFLAGS = '-rc', - LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS, - CXXCOM = '$CXX -o $TARGET -c $CXXFLAGS $_CCCOMCOM $SOURCES') +TARGET = 'rt-thread.' + rtconfig.TARGET_EXT +DefaultEnvironment(tools=[]) +env = Environment(tools = ['mingw'], + AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, + CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS, + AR = rtconfig.AR, ARFLAGS = '-rc', + CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS, + LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS) env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = env["LINKCOM"] + ' --map rtthread.map') + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') 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' +from utils import _make_path_relative +libraries_path_prefix = _make_path_relative(os.path.abspath('./'), libraries_path_prefix) + SDK_LIB = libraries_path_prefix Export('SDK_LIB') @@ -60,14 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) imxrt_library = 'MIMXRT1060' rtconfig.BSP_LIBRARY_TYPE = imxrt_library +bsp_vdir = 'build' + # include libraries -objs.extend(SConscript(os.path.join(libraries_path_prefix, imxrt_library, 'SConscript'))) +objs.extend(SConscript(os.path.join(libraries_path_prefix, imxrt_library, 'SConscript'), + variant_dir=bsp_vdir + '/libraries/'+ imxrt_library, duplicate=0)) # include drivers -objs.extend(SConscript(os.path.join(libraries_path_prefix, 'drivers', 'SConscript'))) +objs.extend(SConscript(os.path.join(libraries_path_prefix, 'drivers', 'SConscript'), + variant_dir=bsp_vdir + '/libraries/drivers', duplicate=0)) -# include peripherals -objs.extend(SConscript(os.path.join(libraries_path_prefix, 'peripherals', 'SConscript'))) +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/imxrt/imxrt1064-nxp-evk/SConstruct b/bsp/imxrt/imxrt1064-nxp-evk/SConstruct index 96668a9c4c..36aaa922d4 100644 --- a/bsp/imxrt/imxrt1064-nxp-evk/SConstruct +++ b/bsp/imxrt/imxrt1064-nxp-evk/SConstruct @@ -15,42 +15,35 @@ except: print(RTT_ROOT) exit(-1) -TARGET = 'rtthread.' + rtconfig.TARGET_EXT -DefaultEnvironment(tools=[]) -if rtconfig.PLATFORM == 'armcc': - env = Environment(tools = ['mingw'], - AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, - CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS, - CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS, - AR = rtconfig.AR, ARFLAGS = '-rc', - LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS, - # overwrite cflags, because cflags has '--C99' - CXXCOM = '$CXX -o $TARGET --cpp -c $CXXFLAGS $_CCCOMCOM $SOURCES') -else: - env = Environment(tools = ['mingw'], - AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, - CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS, - CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS, - AR = rtconfig.AR, ARFLAGS = '-rc', - LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS, - CXXCOM = '$CXX -o $TARGET -c $CXXFLAGS $_CCCOMCOM $SOURCES') +TARGET = 'rt-thread.' + rtconfig.TARGET_EXT +DefaultEnvironment(tools=[]) +env = Environment(tools = ['mingw'], + AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, + CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS, + AR = rtconfig.AR, ARFLAGS = '-rc', + CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS, + LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS) env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = env["LINKCOM"] + ' --map rtthread.map') + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') 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' +from utils import _make_path_relative +libraries_path_prefix = _make_path_relative(os.path.abspath('./'), libraries_path_prefix) + SDK_LIB = libraries_path_prefix Export('SDK_LIB') @@ -60,14 +53,19 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) imxrt_library = 'MIMXRT1064' rtconfig.BSP_LIBRARY_TYPE = imxrt_library +bsp_vdir = 'build' + # include libraries -objs.extend(SConscript(os.path.join(libraries_path_prefix, imxrt_library, 'SConscript'))) +objs.extend(SConscript(os.path.join(libraries_path_prefix, imxrt_library, 'SConscript'), + variant_dir=bsp_vdir + '/libraries/'+ imxrt_library, duplicate=0)) # include drivers -objs.extend(SConscript(os.path.join(libraries_path_prefix, 'drivers', 'SConscript'))) +objs.extend(SConscript(os.path.join(libraries_path_prefix, 'drivers', 'SConscript'), + variant_dir=bsp_vdir + '/libraries/drivers', duplicate=0)) -# include peripherals -objs.extend(SConscript(os.path.join(libraries_path_prefix, 'peripherals', 'SConscript'))) +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/imxrt/libraries/templates/imxrt1050xxx/SConstruct b/bsp/imxrt/libraries/templates/imxrt1050xxx/SConstruct index 923c623f17..e371dfb926 100644 --- a/bsp/imxrt/libraries/templates/imxrt1050xxx/SConstruct +++ b/bsp/imxrt/libraries/templates/imxrt1050xxx/SConstruct @@ -15,41 +15,57 @@ except: print(RTT_ROOT) exit(-1) -TARGET = 'rtthread.' + rtconfig.TARGET_EXT -DefaultEnvironment(tools=[]) -if rtconfig.PLATFORM == 'armcc': - env = Environment(tools = ['mingw'], - AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, - CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS, - CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS, - AR = rtconfig.AR, ARFLAGS = '-rc', - LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS, - # overwrite cflags, because cflags has '--C99' - CXXCOM = '$CXX -o $TARGET --cpp -c $CXXFLAGS $_CCCOMCOM $SOURCES') -else: - env = Environment(tools = ['mingw'], - AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, - CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS, - CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS, - AR = rtconfig.AR, ARFLAGS = '-rc', - LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS, - CXXCOM = '$CXX -o $TARGET -c $CXXFLAGS $_CCCOMCOM $SOURCES') +TARGET = 'rt-thread.' + rtconfig.TARGET_EXT +DefaultEnvironment(tools=[]) +env = Environment(tools = ['mingw'], + AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, + CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS, + AR = rtconfig.AR, ARFLAGS = '-rc', + CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS, + LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS) env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = env["LINKCOM"] + ' --map rtthread.map') + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') 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' + +from utils import _make_path_relative +libraries_path_prefix = _make_path_relative(os.path.abspath('./'), libraries_path_prefix) + +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 + +bsp_vdir = 'build' + +# include libraries +objs.extend(SConscript(os.path.join(libraries_path_prefix, imxrt_library, 'SConscript'), + variant_dir=bsp_vdir + '/libraries/'+ imxrt_library, duplicate=0)) + +# include drivers +objs.extend(SConscript(os.path.join(libraries_path_prefix, 'drivers', 'SConscript'), + variant_dir=bsp_vdir + '/libraries/drivers', duplicate=0)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) diff --git a/bsp/imxrt/libraries/templates/imxrt1064xxx/SConstruct b/bsp/imxrt/libraries/templates/imxrt1064xxx/SConstruct index a3f416164f..edbca1c148 100644 --- a/bsp/imxrt/libraries/templates/imxrt1064xxx/SConstruct +++ b/bsp/imxrt/libraries/templates/imxrt1064xxx/SConstruct @@ -15,41 +15,57 @@ except: print(RTT_ROOT) exit(-1) -TARGET = 'rtthread.' + rtconfig.TARGET_EXT -DefaultEnvironment(tools=[]) -if rtconfig.PLATFORM == 'armcc': - env = Environment(tools = ['mingw'], - AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, - CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS, - CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS, - AR = rtconfig.AR, ARFLAGS = '-rc', - LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS, - # overwrite cflags, because cflags has '--C99' - CXXCOM = '$CXX -o $TARGET --cpp -c $CXXFLAGS $_CCCOMCOM $SOURCES') -else: - env = Environment(tools = ['mingw'], - AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, - CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS, - CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS, - AR = rtconfig.AR, ARFLAGS = '-rc', - LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS, - CXXCOM = '$CXX -o $TARGET -c $CXXFLAGS $_CCCOMCOM $SOURCES') +TARGET = 'rt-thread.' + rtconfig.TARGET_EXT +DefaultEnvironment(tools=[]) +env = Environment(tools = ['mingw'], + AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, + CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS, + AR = rtconfig.AR, ARFLAGS = '-rc', + CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS, + LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS) env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = env["LINKCOM"] + ' --map rtthread.map') + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') 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' + +from utils import _make_path_relative +libraries_path_prefix = _make_path_relative(os.path.abspath('./'), libraries_path_prefix) + +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/MIMXRT1064/SConscript') +imxrt_library = 'MIMXRT1060' +rtconfig.BSP_LIBRARY_TYPE = imxrt_library + +bsp_vdir = 'build' + +# include libraries +objs.extend(SConscript(os.path.join(libraries_path_prefix, imxrt_library, 'SConscript'), + variant_dir=bsp_vdir + '/libraries/'+ imxrt_library, duplicate=0)) + +# include drivers +objs.extend(SConscript(os.path.join(libraries_path_prefix, 'drivers', 'SConscript'), + variant_dir=bsp_vdir + '/libraries/drivers', duplicate=0)) + +bsp_port_script = os.path.join(os.getcwd(), 'board', 'ports', 'SConscript') +if os.path.isfile(bsp_port_script): + objs.extend(SConscript(bsp_port_script, variant_dir=bsp_vdir + '/board/ports', duplicate=0)) # make a building DoBuilding(TARGET, objs) From d9591b6eb3d0bc4931d20ce6ec0064e936baafa9 Mon Sep 17 00:00:00 2001 From: guozhanxin Date: Wed, 30 Mar 2022 01:38:47 +0800 Subject: [PATCH 3/3] revert stm32l0xx change. --- bsp/stm32/stm32l010-st-nucleo/SConstruct | 2 +- bsp/stm32/stm32l053-st-nucleo/SConstruct | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bsp/stm32/stm32l010-st-nucleo/SConstruct b/bsp/stm32/stm32l010-st-nucleo/SConstruct index a47cac3b41..465a4a2ab0 100644 --- a/bsp/stm32/stm32l010-st-nucleo/SConstruct +++ b/bsp/stm32/stm32l010-st-nucleo/SConstruct @@ -50,7 +50,7 @@ Export('SDK_LIB') # prepare building environment objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) -stm32_library = 'STM32L4xx_HAL' +stm32_library = 'STM32L0xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library bsp_vdir = 'build' diff --git a/bsp/stm32/stm32l053-st-nucleo/SConstruct b/bsp/stm32/stm32l053-st-nucleo/SConstruct index a47cac3b41..465a4a2ab0 100644 --- a/bsp/stm32/stm32l053-st-nucleo/SConstruct +++ b/bsp/stm32/stm32l053-st-nucleo/SConstruct @@ -50,7 +50,7 @@ Export('SDK_LIB') # prepare building environment objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) -stm32_library = 'STM32L4xx_HAL' +stm32_library = 'STM32L0xx_HAL' rtconfig.BSP_LIBRARY_TYPE = stm32_library bsp_vdir = 'build'