mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #13738 from leandrolanzieri/pr/cpu/cortexm/cleanup_dependencies
cpu/cortexm: cleanup dependencies
This commit is contained in:
commit
736837d17c
@ -8,3 +8,5 @@ ifneq (,$(filter periph_rtc,$(USEMODULE)))
|
||||
endif
|
||||
|
||||
USEMODULE += pm_layered
|
||||
|
||||
include $(RIOTCPU)/cortexm_common/Makefile.dep
|
||||
|
@ -1 +1,3 @@
|
||||
USEMODULE += periph_common cc26xx_cc13xx_periph
|
||||
|
||||
include $(RIOTCPU)/cortexm_common/Makefile.dep
|
||||
|
20
cpu/cortexm_common/Makefile.dep
Normal file
20
cpu/cortexm_common/Makefile.dep
Normal file
@ -0,0 +1,20 @@
|
||||
# Tell the build system that the CPU depends on the Cortex-M common files:
|
||||
USEMODULE += cortexm_common
|
||||
|
||||
# include common periph code
|
||||
USEMODULE += cortexm_common_periph
|
||||
|
||||
# all cortex MCU's use newlib as libc
|
||||
USEMODULE += newlib
|
||||
|
||||
# use the nano-specs of Newlib when available
|
||||
USEMODULE += newlib_nano
|
||||
|
||||
# Export the peripheral drivers to be linked into the final binary:
|
||||
USEMODULE += periph
|
||||
|
||||
# Use Hardware FPU by default if present
|
||||
FEATURES_OPTIONAL += cortexm_fpu
|
||||
ifneq (,$(filter cortexm_fpu,$(FEATURES_USED)))
|
||||
DEFAULT_MODULE += cortexm_fpu
|
||||
endif
|
@ -5,3 +5,8 @@ FEATURES_PROVIDED += periph_pm
|
||||
FEATURES_PROVIDED += cpp
|
||||
FEATURES_PROVIDED += cpu_check_address
|
||||
FEATURES_PROVIDED += ssp
|
||||
|
||||
# cortex-m4f and cortex-m7 provide FPU support
|
||||
ifneq (,$(filter $(CPU_ARCH),cortex-m4f cortex-m7))
|
||||
FEATURES_PROVIDED += cortexm_fpu
|
||||
endif
|
||||
|
@ -19,3 +19,5 @@ endif
|
||||
|
||||
# include CPU family module
|
||||
USEMODULE += cpu_$(CPU_FAM)
|
||||
|
||||
include $(RIOTCPU)/cortexm_common/Makefile.dep
|
||||
|
1
cpu/ezr32wg/Makefile.dep
Normal file
1
cpu/ezr32wg/Makefile.dep
Normal file
@ -0,0 +1 @@
|
||||
include $(RIOTCPU)/cortexm_common/Makefile.dep
|
@ -4,3 +4,5 @@ endif
|
||||
ifneq (,$(filter periph_i2c,$(USEMODULE)))
|
||||
USEMODULE += core_thread_flags
|
||||
endif
|
||||
|
||||
include $(RIOTCPU)/cortexm_common/Makefile.dep
|
||||
|
1
cpu/lm4f120/Makefile.dep
Normal file
1
cpu/lm4f120/Makefile.dep
Normal file
@ -0,0 +1 @@
|
||||
include $(RIOTCPU)/cortexm_common/Makefile.dep
|
@ -1 +1,3 @@
|
||||
USEMODULE += pm_layered
|
||||
|
||||
include $(RIOTCPU)/cortexm_common/Makefile.dep
|
||||
|
@ -1 +1,2 @@
|
||||
include $(RIOTCPU)/nrf5x_common/Makefile.dep
|
||||
include $(RIOTCPU)/cortexm_common/Makefile.dep
|
||||
|
@ -6,3 +6,4 @@ ifneq (,$(filter nrf802154,$(USEMODULE)))
|
||||
endif
|
||||
|
||||
include $(RIOTCPU)/nrf5x_common/Makefile.dep
|
||||
include $(RIOTCPU)/cortexm_common/Makefile.dep
|
||||
|
@ -7,3 +7,5 @@ USEMODULE += pm_layered
|
||||
|
||||
# include sam0 common periph drivers
|
||||
USEMODULE += sam0_common_periph
|
||||
|
||||
include $(RIOTCPU)/cortexm_common/Makefile.dep
|
||||
|
1
cpu/sam3/Makefile.dep
Normal file
1
cpu/sam3/Makefile.dep
Normal file
@ -0,0 +1 @@
|
||||
include $(RIOTCPU)/cortexm_common/Makefile.dep
|
@ -7,3 +7,5 @@ USEMODULE += stm32_common stm32_common_periph
|
||||
ifneq (,$(filter periph_usbdev,$(FEATURES_USED)))
|
||||
USEMODULE += xtimer
|
||||
endif
|
||||
|
||||
include $(RIOTCPU)/cortexm_common/Makefile.dep
|
||||
|
@ -33,17 +33,6 @@ LINKFLAGS += -T$(LINKER_SCRIPT) -Wl,--fatal-warnings
|
||||
LINKFLAGS += $(CFLAGS_CPU) $(CFLAGS_DBG) $(CFLAGS_OPT) -static -lgcc -nostartfiles
|
||||
LINKFLAGS += -Wl,--gc-sections
|
||||
|
||||
# Tell the build system that the CPU depends on the Cortex-M common files:
|
||||
USEMODULE += cortexm_common
|
||||
# Export the peripheral drivers to be linked into the final binary:
|
||||
USEMODULE += periph
|
||||
# include common periph code
|
||||
USEMODULE += cortexm_common_periph
|
||||
|
||||
# all cortex MCU's use newlib as libc
|
||||
USEMODULE += newlib
|
||||
|
||||
|
||||
# extract version inside the first parentheses
|
||||
ARM_GCC_VERSION = $(shell $(TARGET_ARCH)-gcc --version | sed -n '1 s/[^(]*(\([^\)]*\)).*/\1/p')
|
||||
|
||||
@ -71,24 +60,18 @@ endif # BUILD_IN_DOCKER
|
||||
CFLAGS += -DCPU_MODEL_$(call uppercase_and_underscore,$(CPU_MODEL))
|
||||
CFLAGS += -DCPU_ARCH_$(call uppercase_and_underscore,$(CPU_ARCH))
|
||||
|
||||
# set the compiler specific CPU and FPU options
|
||||
ifneq (,$(filter $(CPU_ARCH),cortex-m4f cortex-m7))
|
||||
ifneq (,$(filter cortexm_fpu,$(DISABLE_MODULE)))
|
||||
CFLAGS_FPU ?= -mfloat-abi=soft
|
||||
# Add corresponding FPU CFLAGS
|
||||
# clang assumes there is an FPU, no CFLAGS necessary
|
||||
ifneq (llvm, $(TOOLCHAIN))
|
||||
ifeq ($(CPU_ARCH),cortex-m7)
|
||||
_CORTEX_HW_FPU_CFLAGS = -mfloat-abi=hard -mfpu=fpv5-sp-d16
|
||||
else
|
||||
USEMODULE += cortexm_fpu
|
||||
# clang assumes there is an FPU
|
||||
ifneq (llvm,$(TOOLCHAIN))
|
||||
ifeq ($(CPU_ARCH),cortex-m7)
|
||||
CFLAGS_FPU ?= -mfloat-abi=hard -mfpu=fpv5-sp-d16
|
||||
else
|
||||
CFLAGS_FPU ?= -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
endif
|
||||
endif
|
||||
_CORTEX_HW_FPU_CFLAGS = -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
endif
|
||||
else
|
||||
CFLAGS_FPU ?= -mfloat-abi=soft
|
||||
endif
|
||||
# Add soft or hard FPU CFLAGS depending on the module
|
||||
# NOTE: This can be turned into normal conditional syntax once #9913 is fixed
|
||||
CFLAGS_FPU ?= $(if $(filter cortexm_fpu,$(USEMODULE)),$(_CORTEX_HW_FPU_CFLAGS),-mfloat-abi=soft)
|
||||
|
||||
ifeq ($(CPU_ARCH),cortex-m4f)
|
||||
MCPU = cortex-m4
|
||||
@ -126,9 +109,6 @@ endif
|
||||
# CPU depends on the cortex-m common module, so include it:
|
||||
include $(RIOTCPU)/cortexm_common/Makefile.include
|
||||
|
||||
# use the nano-specs of Newlib when available
|
||||
USEMODULE += newlib_nano
|
||||
|
||||
# Avoid overriding the default rule:
|
||||
all:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user