From 4198b7518cde31c3e22cc5bfff949d4301f4632b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ren=C3=A9=20Kijewski?= <rene.kijewski@fu-berlin.de>
Date: Tue, 22 Apr 2014 16:53:16 +0200
Subject: [PATCH]  make: add `BOARD_INSUFFICIENT_RAM` blacklisting

Currently most blacklistings for examples and tests are done because the
board provides too little RAM or ROM. Besides of the actual linking all
the compiling should nevertheless work just fine.

This PR adds the variable `BOARD_INSUFFICIENT_RAM` to tell the
`buildtest` to compile the code for a board, but omit the linking step.
---
 Makefile.buildtests | 6 +++++-
 Makefile.include    | 2 ++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/Makefile.buildtests b/Makefile.buildtests
index bc0f7e26e2..6a705b3900 100644
--- a/Makefile.buildtests
+++ b/Makefile.buildtests
@@ -42,7 +42,10 @@ buildtest:
 	\
 	rm -rf "$$BINDIRBASE"; \
 	for BOARD in $${BOARDS}; do \
-		$${ECHO} -n "Building for $${BOARD} .. "; \
+		RIOTNOLINK=$$(case ' $(BOARD_INSUFFICIENT_RAM) ' in *" $${BOARD} "*) echo 1; esac); \
+		$${ECHO} -n "Building for $${BOARD} "; \
+		[ -n "$${RIOTNOLINK}" ] && $${ECHO} -n "(no linking) "; \
+		$${ECHO} -n ".. "; \
 		LOG=$$(env -i \
 			HOME=$${HOME} \
 			PATH=$${PATH} \
@@ -51,6 +54,7 @@ buildtest:
 			RIOTBOARD=$${RIOTBOARD} \
 			RIOTCPU=$${RIOTCPU} \
 			BINDIRBASE=$${BINDIRBASE} \
+			RIOTNOLINK=$${RIOTNOLINK} \
 			$(MAKE) -j$(NPROC) 2>&1 >/dev/null) ; \
 		if [ "$${?}" = "0" ]; then \
 			$${ECHO} "$${GREEN}success$${RESET}"; \
diff --git a/Makefile.include b/Makefile.include
index 9dbdf9b942..fc209e41fe 100644
--- a/Makefile.include
+++ b/Makefile.include
@@ -75,6 +75,7 @@ all: $(BINDIR)$(PROJECT).a
 	@echo "Building application $(PROJECT) for $(BOARD) w/ MCU $(MCU)."
 	"$(MAKE)" -C $(RIOTBOARD)/$(BOARD)
 	"$(MAKE)" -C $(RIOTBASE)
+ifeq (,$(RIOTNOLINK))
 ifeq ($(BUILDOSXNATIVE),1)
 	$(AD)$(LINK) $(UNDEF) -o $(ELFFILE) $(BASELIBS) $(LINKFLAGS) -Wl,-no_pie
 else
@@ -82,6 +83,7 @@ else
 endif
 	$(AD)$(SIZE) $(ELFFILE)
 	$(AD)$(OBJCOPY) $(OFLAGS) $(ELFFILE) $(HEXFILE)
+endif
 
 # string array of all names of c files in dir
 SRC = $(wildcard *.c)
-- 
GitLab