cpu/efm32: add families/%/Makefile.include

Move INCLUDES and VECTORS_O to Makefile.include duplicate EFM32_HEADER
while cpu.txt is not migrated.
This commit is contained in:
Francisco Molina 2020-02-11 22:31:00 +01:00
parent 5715f13323
commit a0462488e8
No known key found for this signature in database
GPG Key ID: 3E94EAC3DBDEEDA8
8 changed files with 70 additions and 10 deletions

View File

@ -1,17 +1,21 @@
include $(RIOTCPU)/efm32/efm32-info.mk 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 # the size of riotboot on the EFM32 exceeds the default value
RIOTBOOT_LEN ?= 0x2000 RIOTBOOT_LEN ?= 0x2000
# 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$(call uppercase_and_underscore,$(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 # include cortexm_common
LINKER_SCRIPT = cortexm.ld LINKER_SCRIPT = cortexm.ld

View File

@ -1,10 +1,6 @@
# Find the header file that should exist if the CPU is supported. # Find the header file that should exist if the CPU is supported.
EFM32_HEADER = $(wildcard $(RIOTCPU)/efm32/families/*/include/vendor/$(CPU_MODEL).h) 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. # Lookup up CPU information using grep.
EFM32_INFO = $(shell grep $(CPU_MODEL) $(shell dirname $(EFM32_HEADER))/../../cpus.txt) EFM32_INFO = $(shell grep $(CPU_MODEL) $(shell dirname $(EFM32_HEADER))/../../cpus.txt)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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