From 08d2fae40be249e2a896ad85cd8d30841a3d7ef0 Mon Sep 17 00:00:00 2001 From: cladmi Date: Tue, 11 Sep 2018 14:13:08 +0200 Subject: [PATCH] Makefile.features: assert CPU has been defined by BOARD/Makefile.features CPU must now be defined by `$(RIOTBOARD)/$(BOARD)/Makefile.features` or one of its common included Makefile.features file. The cpu `Makefile.dep` file can now automatically be included when it exists. --- Makefile.dep | 8 ++------ Makefile.features | 14 +++++--------- Makefile.include | 7 ------- 3 files changed, 7 insertions(+), 22 deletions(-) diff --git a/Makefile.dep b/Makefile.dep index 1339dbca5c22e..cc1808a1278d0 100644 --- a/Makefile.dep +++ b/Makefile.dep @@ -5,12 +5,8 @@ OLD_USEPKG := $(sort $(USEPKG)) # include board dependencies -include $(RIOTBOARD)/$(BOARD)/Makefile.dep -# Transitional conditional include until all boards define 'CPU' in -# Makefile.features -ifneq (,$(CPU)) - # include cpu dependencies - -include $(RIOTCPU)/$(CPU)/Makefile.dep -endif +# include cpu dependencies +-include $(RIOTCPU)/$(CPU)/Makefile.dep # include external modules dependencies # processed before RIOT ones to be evaluated before the 'default' rules. diff --git a/Makefile.features b/Makefile.features index 4cdf39e56e8d7..7c555c84b1c23 100644 --- a/Makefile.features +++ b/Makefile.features @@ -5,19 +5,15 @@ # This makes them available when setting features based on CPU_MODEL in the cpu # Makefile.features and also during dependency resolution. -# Transition: -# Moving 'CPU/CPU_MODEL' to Makefile.features is an ongoing work and may not -# reflect the state of all boards for the moment. - include $(RIOTBOARD)/$(BOARD)/Makefile.features -# Transitional conditional include until all boards define 'CPU' -ifneq (,$(CPU)) - include $(RIOTCPU)/$(CPU)/Makefile.features -else - $(warning CPU must be defined by board / board_common Makefile.features) +# Sanity check +ifeq (,$(CPU)) + $(error CPU must be defined by board / board_common Makefile.features) endif +include $(RIOTCPU)/$(CPU)/Makefile.features + # Resolve FEATURES_ variables # Their value will only be complete after resolving dependencies diff --git a/Makefile.include b/Makefile.include index 2a46ae2c068bb..74519b50a6c44 100644 --- a/Makefile.include +++ b/Makefile.include @@ -298,13 +298,6 @@ include $(RIOTBOARD)/$(BOARD)/Makefile.include INCLUDES += -I$(RIOTCPU)/$(CPU)/include include $(RIOTCPU)/$(CPU)/Makefile.include -# Sanity check -# The check is only done after 'include $(RIOTBOARD)/$(BOARD)/Makefile.include' -# because we need to have the 'CPU' variable defined -ifeq (,$(filter $(RIOTCPU)/$(CPU)/Makefile.features,$(MAKEFILE_LIST))) - $(error $$(RIOTCPU)/$$(CPU)/Makefile.features must have been included by the board / board common Makefile.features or Makefile.features) -endif - # Assume GCC/GNU as supported toolchain if CPU's Makefile.include doesn't # provide this macro TOOLCHAINS_SUPPORTED ?= gnu