Merge pull request #12340 from cladmi/pr/makefiles/board_cpu_macros
makefiles: CFLAGS convert to the uppercase function instead of using the shell
This commit is contained in:
commit
5105a2e54d
@ -340,9 +340,9 @@ ifeq ($(RIOT_CI_BUILD),1)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# if you want to publish the board into the sources as an uppercase #define
|
# if you want to publish the board into the sources as an uppercase #define
|
||||||
BOARDDEF := $(shell echo $(BOARD) | tr 'a-z' 'A-Z' | tr '-' '_')
|
BOARDDEF = $(call uppercase_and_underscore,$(BOARD))
|
||||||
CPUDEF := $(shell echo $(CPU) | tr 'a-z' 'A-Z' | tr '-' '_')
|
CPUDEF = $(call uppercase_and_underscore,$(CPU))
|
||||||
MCUDEF := $(shell echo $(MCU) | tr 'a-z' 'A-Z' | tr '-' '_')
|
MCUDEF = $(call uppercase_and_underscore,$(MCU))
|
||||||
CFLAGS += -DRIOT_APPLICATION=\"$(APPLICATION)\"
|
CFLAGS += -DRIOT_APPLICATION=\"$(APPLICATION)\"
|
||||||
CFLAGS += -DBOARD_$(BOARDDEF)=\"$(BOARD)\" -DRIOT_BOARD=BOARD_$(BOARDDEF)
|
CFLAGS += -DBOARD_$(BOARDDEF)=\"$(BOARD)\" -DRIOT_BOARD=BOARD_$(BOARDDEF)
|
||||||
CFLAGS += -DCPU_$(CPUDEF)=\"$(CPU)\" -DRIOT_CPU=CPU_$(CPUDEF)
|
CFLAGS += -DCPU_$(CPUDEF)=\"$(CPU)\" -DRIOT_CPU=CPU_$(CPUDEF)
|
||||||
|
|||||||
@ -4,7 +4,7 @@ export CPU_ARCH = $(EFM32_ARCHITECTURE)
|
|||||||
export CPU_FAM = $(EFM32_FAMILY)
|
export CPU_FAM = $(EFM32_FAMILY)
|
||||||
|
|
||||||
# the em_device.h header requires a global define with the cpu model
|
# the em_device.h header requires a global define with the cpu model
|
||||||
CFLAGS += -D$(shell echo $(CPU_MODEL) | tr 'a-z' 'A-Z')
|
CFLAGS += -D$(call uppercase_and_underscore,$(CPU_MODEL))
|
||||||
|
|
||||||
# include Gecko SDK package
|
# include Gecko SDK package
|
||||||
USEPKG += gecko_sdk
|
USEPKG += gecko_sdk
|
||||||
|
|||||||
@ -2,8 +2,7 @@ PSEUDOMODULES += msp430_malloc
|
|||||||
|
|
||||||
INCLUDES += -I$(RIOTCPU)/msp430_common/include/
|
INCLUDES += -I$(RIOTCPU)/msp430_common/include/
|
||||||
|
|
||||||
MODEL = $(shell echo $(CPU_MODEL) | tr 'a-z' 'A-Z')
|
CFLAGS += -DCPU_MODEL_$(call uppercase_and_underscore,$(CPU_MODEL))
|
||||||
CFLAGS += -DCPU_MODEL_$(MODEL)
|
|
||||||
|
|
||||||
export UNDEF += $(BINDIR)/msp430_common/startup.o
|
export UNDEF += $(BINDIR)/msp430_common/startup.o
|
||||||
export USEMODULE += msp430_common msp430_common_periph msp430_malloc
|
export USEMODULE += msp430_common msp430_common_periph msp430_malloc
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
FAM = $(shell echo $(CPU_FAM) | tr 'a-z-' 'A-Z_')
|
CFLAGS += -DCPU_FAM_$(call uppercase_and_underscore,$(CPU_FAM))
|
||||||
CFLAGS += -DCPU_FAM_$(FAM)
|
|
||||||
|
|
||||||
# include nrf5x common periph drivers
|
# include nrf5x common periph drivers
|
||||||
USEMODULE += nrf5x_common_periph
|
USEMODULE += nrf5x_common_periph
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
# Define the CPU family so we can differentiate between them in the code
|
# Define the CPU family so we can differentiate between them in the code
|
||||||
CFLAGS += -DCPU_FAM_$(shell echo $(CPU_FAM) | tr 'a-z-' 'A-Z_')
|
CFLAGS += -DCPU_FAM_$(call uppercase_and_underscore,$(CPU_FAM))
|
||||||
|
|
||||||
# Set ROM and RAM lengths according to CPU model
|
# Set ROM and RAM lengths according to CPU model
|
||||||
ifneq (,$(filter samd21g18a samd21j18a saml21j18b saml21j18a samr21e18a \
|
ifneq (,$(filter samd21g18a samd21j18a saml21j18b saml21j18a samr21e18a \
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
# Define the CPU family so we can differentiate between them in the code
|
# Define the CPU family so we can differentiate between them in the code
|
||||||
CFLAGS += -DCPU_FAM_$(shell echo $(CPU_FAM) | tr 'a-z-' 'A-Z_')
|
CFLAGS += -DCPU_FAM_$(call uppercase_and_underscore,$(CPU_FAM))
|
||||||
|
|
||||||
# this CPU implementation doesn't use CMSIS initialization
|
# this CPU implementation doesn't use CMSIS initialization
|
||||||
CFLAGS += -DDONT_USE_CMSIS_INIT
|
CFLAGS += -DDONT_USE_CMSIS_INIT
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
FAM = $(shell echo $(CPU_FAM) | tr 'a-z-' 'A-Z_')
|
CFLAGS += -DCPU_FAM_$(call uppercase_and_underscore,$(CPU_FAM))
|
||||||
CFLAGS += -DCPU_FAM_$(FAM)
|
|
||||||
|
|
||||||
# All stm32 families provide pm support
|
# All stm32 families provide pm support
|
||||||
USEMODULE += pm_layered
|
USEMODULE += pm_layered
|
||||||
|
|||||||
@ -81,10 +81,8 @@ endif
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
MODEL = $(shell echo $(CPU_MODEL) | tr 'a-z' 'A-Z')
|
CFLAGS += -DCPU_MODEL_$(call uppercase_and_underscore,$(CPU_MODEL))
|
||||||
CFLAGS += -DCPU_MODEL_$(MODEL)
|
CFLAGS += -DCPU_ARCH_$(call uppercase_and_underscore,$(CPU_ARCH))
|
||||||
ARCH = $(shell echo $(CPU_ARCH) | tr 'a-z-' 'A-Z_')
|
|
||||||
CFLAGS += -DCPU_ARCH_$(ARCH)
|
|
||||||
|
|
||||||
# set the compiler specific CPU and FPU options
|
# set the compiler specific CPU and FPU options
|
||||||
ifneq (,$(filter $(CPU_ARCH),cortex-m4f cortex-m7))
|
ifneq (,$(filter $(CPU_ARCH),cortex-m4f cortex-m7))
|
||||||
|
|||||||
@ -3,7 +3,7 @@ _ALLMODULES = $(sort $(USEMODULE) $(USEPKG))
|
|||||||
# Define MODULE_MODULE_NAME preprocessor macros for all modules.
|
# Define MODULE_MODULE_NAME preprocessor macros for all modules.
|
||||||
ED = $(addprefix MODULE_,$(_ALLMODULES))
|
ED = $(addprefix MODULE_,$(_ALLMODULES))
|
||||||
# EXTDEFINES will be put in CFLAGS_WITH_MACROS
|
# EXTDEFINES will be put in CFLAGS_WITH_MACROS
|
||||||
EXTDEFINES = $(addprefix -D,$(shell echo '$(ED)' | tr 'a-z-' 'A-Z_'))
|
EXTDEFINES = $(addprefix -D,$(call uppercase_and_underscore,$(ED)))
|
||||||
|
|
||||||
# filter "pseudomodules" from "real modules", but not "no_pseudomodules"
|
# filter "pseudomodules" from "real modules", but not "no_pseudomodules"
|
||||||
REALMODULES += $(filter-out $(PSEUDOMODULES), $(_ALLMODULES))
|
REALMODULES += $(filter-out $(PSEUDOMODULES), $(_ALLMODULES))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user