Skip to content

Commit 79445c2

Browse files
authored
Merge pull request #3306 from hathach/refactor-buildsystem
Refactor buildsystem and bsp
2 parents 38255ff + 4dfac3f commit 79445c2

File tree

323 files changed

+3463
-1495
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

323 files changed

+3463
-1495
lines changed

.github/workflows/ci_set_matrix.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@
3131
"msp430": ["msp430-gcc"],
3232
"msp432e4 tm4c": ["arm-gcc"],
3333
"nrf": ["arm-gcc", "arm-clang"],
34+
"nuc100_120 nuc121_125 nuc126 nuc505": ["arm-gcc"],
3435
"ra": ["arm-gcc"],
3536
"rp2040": ["arm-gcc"],
3637
"rx": ["rx-gcc"],
37-
"samd11 saml2x": ["arm-gcc", "arm-clang"],
38-
"samd21": ["arm-gcc", "arm-clang"],
38+
"samd11 samd2x_l2x": ["arm-gcc", "arm-clang"],
3939
"samd5x_e5x samg": ["arm-gcc", "arm-clang"],
4040
"stm32c0 stm32f0 stm32f1 stm32f2 stm32f3": ["arm-gcc", "arm-clang", "arm-iar"],
4141
"stm32f4": ["arm-gcc", "arm-clang", "arm-iar"],

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ latex
2020
*.ewt
2121
*.ewd
2222
*.hex
23+
.venv/
2324
cmake_install.cmake
2425
CMakeCache.txt
2526
settings/

examples/build_system/cmake/toolchain/common.cmake

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ include(${CMAKE_CURRENT_LIST_DIR}/../cpu/${CMAKE_SYSTEM_CPU}.cmake)
2020
# ----------------------------------------------------------------------------
2121
# Compile flags
2222
# ----------------------------------------------------------------------------
23-
if (TOOLCHAIN STREQUAL "gcc")
23+
if (TOOLCHAIN STREQUAL "gcc" OR TOOLCHAIN STREQUAL "clang")
2424
list(APPEND TOOLCHAIN_COMMON_FLAGS
2525
-fdata-sections
2626
-ffunction-sections
27-
-fsingle-precision-constant
27+
# -fsingle-precision-constant # not supported by clang
2828
-fno-strict-aliasing
2929
)
3030
list(APPEND TOOLCHAIN_EXE_LINKER_FLAGS
@@ -34,22 +34,9 @@ if (TOOLCHAIN STREQUAL "gcc")
3434
)
3535

3636
elseif (TOOLCHAIN STREQUAL "iar")
37-
#list(APPEND TOOLCHAIN_COMMON_FLAGS)
3837
list(APPEND TOOLCHAIN_EXE_LINKER_FLAGS
3938
--diag_suppress=Li065
4039
)
41-
42-
elseif (TOOLCHAIN STREQUAL "clang")
43-
list(APPEND TOOLCHAIN_COMMON_FLAGS
44-
-fdata-sections
45-
-ffunction-sections
46-
-fno-strict-aliasing
47-
)
48-
list(APPEND TOOLCHAIN_EXE_LINKER_FLAGS
49-
-Wl,--print-memory-usage
50-
-Wl,--gc-sections
51-
-Wl,--cref
52-
)
5340
endif ()
5441

5542
# join the toolchain flags into a single string
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
include ../../build_system/make/make.mk
1+
include ../../../hw/bsp/family_support.mk
22

33
INC += \
44
src \
5-
$(TOP)/hw \
5+
66

77
# Example source
88
EXAMPLE_SOURCE += \
99
src/main.c \
1010
src/usb_descriptors.c \
1111

12-
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
12+
SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE))
1313

14-
include ../../build_system/make/rules.mk
14+
include ../../../hw/bsp/family_rules.mk
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
RTOS = freertos
2-
include ../../build_system/make/make.mk
2+
include ../../../hw/bsp/family_support.mk
33

44
INC += \
55
src \
6-
$(TOP)/hw \
6+
77

88
# Example source
99
EXAMPLE_SOURCE = \
1010
src/main.c \
1111
src/usb_descriptors.c
1212

13-
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
13+
SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE))
1414

15-
include ../../build_system/make/rules.mk
15+
include ../../../hw/bsp/family_rules.mk

examples/device/audio_4_channel_mic_freertos/skip.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ board:lpcxpresso11u37
1717
board:lpcxpresso1347
1818
family:broadcom_32bit
1919
family:broadcom_64bit
20+
family:nuc121_125
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
include ../../build_system/make/make.mk
1+
include ../../../hw/bsp/family_support.mk
22

33
INC += \
44
src \
5-
$(TOP)/hw \
5+
66

77
# Example source
88
EXAMPLE_SOURCE += $(wildcard src/*.c)
9-
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
9+
SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE))
1010

11-
include ../../build_system/make/rules.mk
11+
include ../../../hw/bsp/family_rules.mk
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
RTOS = freertos
2-
include ../../build_system/make/make.mk
2+
include ../../../hw/bsp/family_support.mk
33

44
INC += \
55
src \
6-
$(TOP)/hw \
6+
77

88
# Example source
99
EXAMPLE_SOURCE = \
1010
src/main.c \
1111
src/usb_descriptors.c
1212

13-
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
13+
SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE))
1414

15-
include ../../build_system/make/rules.mk
15+
include ../../../hw/bsp/family_rules.mk

examples/device/audio_test_freertos/skip.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ mcu:RAXXX
1515
family:broadcom_32bit
1616
family:broadcom_64bit
1717
board:stm32l0538disco
18+
family:nuc121_125
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
include ../../build_system/make/make.mk
1+
include ../../../hw/bsp/family_support.mk
22

33
INC += \
44
src \
5-
$(TOP)/hw \
5+
66

77
# Example source
88
EXAMPLE_SOURCE += $(wildcard src/*.c)
9-
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
9+
SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE))
1010

11-
include ../../build_system/make/rules.mk
11+
include ../../../hw/bsp/family_rules.mk

0 commit comments

Comments
 (0)