From 376b09b8755d96b5ea7e26c8d3b257dbc3830e5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Harter?= Date: Thu, 2 May 2019 11:49:20 +0200 Subject: [PATCH] Makefile.features: include CPU/Makefile.features when CPU is defined Prepare for when boards define `CPU` in `BOARD/Makefile.features`. Include '$(RIOTCPU)/$(CPU)/Makefile.features' directly when it is defined. This will allow removing the file inclusion from the `BOARD/Makefile.features`. The board must then not include it directly. Transitional change to allow migrating part by parts. Part of moving CPU/CPU_MODEL definition to Makefile.features to have it available before Makefile.include. --- Makefile.features | 5 +++++ Makefile.include | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile.features b/Makefile.features index b26495ab38..2c744e96a4 100644 --- a/Makefile.features +++ b/Makefile.features @@ -11,6 +11,11 @@ include $(RIOTBOARD)/$(BOARD)/Makefile.features +# Transitional conditional include until all boards define 'CPU' +ifneq (,$(CPU)) + include $(RIOTCPU)/$(CPU)/Makefile.features +endif + # Resolve FEATURES_ variables # Their value will only be complete after resolving dependencies diff --git a/Makefile.include b/Makefile.include index 62f9b39895..4011cb0d8a 100644 --- a/Makefile.include +++ b/Makefile.include @@ -275,7 +275,7 @@ include $(RIOTCPU)/$(CPU)/Makefile.include # 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) + $(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