From e6d5af4b8f3646863b0f838c364ba34a1e1fce5a Mon Sep 17 00:00:00 2001
From: Martin Lenders <mail@martin-lenders.de>
Date: Tue, 21 Jan 2014 14:05:56 +0100
Subject: [PATCH] Introduce board blacklists and board whitelists

---
 Makefile.include | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/Makefile.include b/Makefile.include
index 4c063a324f..27267a9b63 100644
--- a/Makefile.include
+++ b/Makefile.include
@@ -12,6 +12,18 @@ ifeq ($(strip $(MCU)),)
 	MCU = $(CPU)
 endif
 
+ifeq (,$(filter buildtest,$(MAKECMDGOALS)))
+	ifneq (,$(BOARD_WHITELIST))
+		ifeq (,$(filter $(BOARD),$(BOARD_WHITELIST)))
+$(error This application only runs on following boards: $(BOARD_WHITELIST))
+		endif
+	endif
+
+	ifneq (,$(findstring $(BOARD),$(BOARD_BLACKLIST)))
+$(error This application does not run on following boards: $(BOARD_BLACKLIST))
+	endif
+endif
+
 # if you want to publish the board into the sources as an uppercase #define
 BB = $(shell echo $(BOARD)|tr 'a-z' 'A-Z')
 CPUDEF = $(shell echo $(CPU)|tr 'a-z' 'A-Z')
@@ -116,7 +128,18 @@ buildtest:
 		ECHO='echo'; \
 	fi; \
 	\
-	for BOARD in $$(find $(RIOTBOARD) -mindepth 1 -maxdepth 1 -type d \! -name \*-common -printf '%f\n' ); do \
+	if [ -z "$(BOARD_WHITELIST)" ]; then \
+		BOARDS=$$(find $(RIOTBOARD) -mindepth 1 -maxdepth 1 -type d \! -name \*-common -printf '%f\n' ); \
+	else \
+		BOARDS="$(BOARD_WHITELIST)"; \
+	fi; \
+	\
+	for BOARD in $(BOARD_BLACKLIST); do \
+		echo "Ignoring $${BOARD} (blacklisted)"; \
+		BOARDS=$$(echo \ $${BOARDS}\  | sed -e 's/ '$${BOARD}' / /'); \
+	done; \
+	\
+	for BOARD in $${BOARDS}; do \
 		$${ECHO} -n "Building for $${BOARD} .. "; \
 		env -i \
 			HOME=$${HOME} \
-- 
GitLab