From d809d82b9190d7e05e3df505713542023786e26d Mon Sep 17 00:00:00 2001
From: cladmi <gaetan.harter@fu-berlin.de>
Date: Fri, 28 Sep 2018 18:37:38 +0200
Subject: [PATCH] Makefile.include: sanity check that cpu Makefile.features is
 used

This prepares for being able to always include Makefile.features
globally. It prevents new board for missing this until it is done.
---
 Makefile.include | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/Makefile.include b/Makefile.include
index dc336ef576..6646a29bd1 100644
--- a/Makefile.include
+++ b/Makefile.include
@@ -246,6 +246,13 @@ 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)
+endif
+
 # Assume GCC/GNU as supported toolchain if CPU's Makefile.include doesn't
 # provide this macro
 TOOLCHAINS_SUPPORTED ?= gnu
-- 
GitLab