diff --git a/cpu/efm32/Makefile.include b/cpu/efm32/Makefile.include index 3d49f9b6fa..1dc766b3d2 100644 --- a/cpu/efm32/Makefile.include +++ b/cpu/efm32/Makefile.include @@ -1,17 +1,21 @@ include $(RIOTCPU)/efm32/efm32-info.mk +# HACK: here we would want to look into USEMODULE to include Makefile.include +# but since Makefile.dep is still resolved after Makefile.include we can't do +# something like `$(filter cpu_efm32%,$(USEMODULE))`. This is why we use +# `cpu_$(CPU_FAM)` for something that is MODULE related. +include $(RIOTCPU)/efm32/families/$(CPU_FAM)/Makefile.include + +ifeq (,$(EFM32_HEADER)) + $(error Header file for $(CPU_MODEL) is missing) +endif + # the size of riotboot on the EFM32 exceeds the default value RIOTBOOT_LEN ?= 0x2000 # the em_device.h header requires a global define with the cpu model CFLAGS += -D$(call uppercase_and_underscore,$(CPU_MODEL)) -# vectors.o is provided by 'cpu_$(EFM32_FAMILY)' and not by 'cpu' -VECTORS_O := $(BINDIR)/cpu_$(EFM32_FAMILY)/vectors.o - -# include vendor device headers -INCLUDES += -I$(RIOTCPU)/efm32/families/$(EFM32_FAMILY)/include/vendor - # include cortexm_common LINKER_SCRIPT = cortexm.ld diff --git a/cpu/efm32/efm32-info.mk b/cpu/efm32/efm32-info.mk index 83ee62dd74..c7ea8e547a 100644 --- a/cpu/efm32/efm32-info.mk +++ b/cpu/efm32/efm32-info.mk @@ -1,10 +1,6 @@ # Find the header file that should exist if the CPU is supported. EFM32_HEADER = $(wildcard $(RIOTCPU)/efm32/families/*/include/vendor/$(CPU_MODEL).h) -ifeq (,$(EFM32_HEADER)) - $(error Header file for $(CPU_MODEL) is missing) -endif - # Lookup up CPU information using grep. EFM32_INFO = $(shell grep $(CPU_MODEL) $(shell dirname $(EFM32_HEADER))/../../cpus.txt) diff --git a/cpu/efm32/families/efm32gg/Makefile.include b/cpu/efm32/families/efm32gg/Makefile.include new file mode 100644 index 0000000000..bf3dceba2b --- /dev/null +++ b/cpu/efm32/families/efm32gg/Makefile.include @@ -0,0 +1,10 @@ +# Find the header file that should exist if the CPU is supported. Only headers +# for supported boards are included, but to support another CPU, it should be +# as easy as adding the header file only. +EFM32_HEADER = $(wildcard $(RIOTCPU)/efm32/families/efm32gg/include/vendor/$(CPU_MODEL).h) + +# vectors.o is provided by 'cpu_$(CPU_FAM)' module and not by 'cpu' +VECTORS_O = $(BINDIR)/cpu_efm32gg/vectors.o + +# include vendor device headers +INCLUDES += -I$(RIOTCPU)/efm32/families/efm32gg/include/vendor diff --git a/cpu/efm32/families/efm32lg/Makefile.include b/cpu/efm32/families/efm32lg/Makefile.include new file mode 100644 index 0000000000..736f74d238 --- /dev/null +++ b/cpu/efm32/families/efm32lg/Makefile.include @@ -0,0 +1,10 @@ +# Find the header file that should exist if the CPU is supported. Only headers +# for supported boards are included, but to support another CPU, it should be +# as easy as adding the header file only. +EFM32_HEADER = $(wildcard $(RIOTCPU)/efm32/families/efm32lg/include/vendor/$(CPU_MODEL).h) + +# vectors.o is provided by 'cpu_$(CPU_FAM)' module and not by 'cpu' +VECTORS_O = $(BINDIR)/cpu_efm32lg/vectors.o + +# include vendor device headers +INCLUDES += -I$(RIOTCPU)/efm32/families/efm32lg/include/vendor diff --git a/cpu/efm32/families/efm32pg12b/Makefile.include b/cpu/efm32/families/efm32pg12b/Makefile.include new file mode 100644 index 0000000000..0fc8605d4b --- /dev/null +++ b/cpu/efm32/families/efm32pg12b/Makefile.include @@ -0,0 +1,10 @@ +# Find the header file that should exist if the CPU is supported. Only headers +# for supported boards are included, but to support another CPU, it should be +# as easy as adding the header file only. +EFM32_HEADER = $(wildcard $(RIOTCPU)/efm32/families/efm32pg12b/include/vendor/$(CPU_MODEL).h) + +# vectors.o is provided by 'cpu_$(CPU_FAM)' module and not by 'cpu' +VECTORS_O = $(BINDIR)/cpu_efm32pg12b/vectors.o + +# include vendor device headers +INCLUDES += -I$(RIOTCPU)/efm32/families/efm32pg12b/include/vendor diff --git a/cpu/efm32/families/efm32pg1b/Makefile.include b/cpu/efm32/families/efm32pg1b/Makefile.include new file mode 100644 index 0000000000..056dd3c742 --- /dev/null +++ b/cpu/efm32/families/efm32pg1b/Makefile.include @@ -0,0 +1,10 @@ +# Find the header file that should exist if the CPU is supported. Only headers +# for supported boards are included, but to support another CPU, it should be +# as easy as adding the header file only. +EFM32_HEADER = $(wildcard $(RIOTCPU)/efm32/families/efm32pg1b/include/vendor/$(CPU_MODEL).h) + +# vectors.o is provided by 'cpu_$(CPU_FAM)' module and not by 'cpu' +VECTORS_O = $(BINDIR)/cpu_efm32pg1b/vectors.o + +# include vendor device headers +INCLUDES += -I$(RIOTCPU)/efm32/families/efm32pg1b/include/vendor diff --git a/cpu/efm32/families/efr32mg12p/Makefile.include b/cpu/efm32/families/efr32mg12p/Makefile.include new file mode 100644 index 0000000000..be38e43843 --- /dev/null +++ b/cpu/efm32/families/efr32mg12p/Makefile.include @@ -0,0 +1,10 @@ +# Find the header file that should exist if the CPU is supported. Only headers +# for supported boards are included, but to support another CPU, it should be +# as easy as adding the header file only. +EFM32_HEADER = $(wildcard $(RIOTCPU)/efm32/families/efr32mg12p/include/vendor/$(CPU_MODEL).h) + +# vectors.o is provided by 'cpu_$(CPU_FAM)' module and not by 'cpu' +VECTORS_O = $(BINDIR)/cpu_efr32mg12p/vectors.o + +# include vendor device headers +INCLUDES += -I$(RIOTCPU)/efm32/families/efr32mg12p/include/vendor diff --git a/cpu/efm32/families/efr32mg1p/Makefile.include b/cpu/efm32/families/efr32mg1p/Makefile.include new file mode 100644 index 0000000000..d6dc5144d8 --- /dev/null +++ b/cpu/efm32/families/efr32mg1p/Makefile.include @@ -0,0 +1,10 @@ +# Find the header file that should exist if the CPU is supported. Only headers +# for supported boards are included, but to support another CPU, it should be +# as easy as adding the header file only. +EFM32_HEADER = $(wildcard $(RIOTCPU)/efm32/families/efr32mg1p/include/vendor/$(CPU_MODEL).h) + +# vectors.o is provided by 'cpu_$(CPU_FAM)' module and not by 'cpu' +VECTORS_O = $(BINDIR)/cpu_efr32mg1p/vectors.o + +# include vendor device headers +INCLUDES += -I$(RIOTCPU)/efm32/families/efr32mg1p/include/vendor