From 8559f6f48a50d65b3eb7ca23c0208cf19d59bdff Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Tue, 7 Apr 2020 12:13:06 -0600 Subject: [PATCH] Allow clean to be run without BOARD being set --- Makefile | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index ccdbb87..82ef2e8 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,14 @@ -include config.mk -# Target to remove build artifacts -clean: - rm -rf build - # Parameter for current board ifeq ($(BOARD),) -$(info $(shell echo Please set BOARD to one of the following)) -$(info $(shell cd src/board && echo */*)) -$(error BOARD not set) -endif - +all: + @echo "Please set BOARD to one of the following:" + @cd src/board && for board in */*; do \ + echo " $$board"; \ + done + @exit 1 +else # Calculate version DATE=$(shell git show --format="%cd" --date="format:%Y-%m-%d" --no-patch) REV=$(shell git describe --always --dirty) @@ -54,3 +52,8 @@ CFLAGS+=-I$(ARCH_DIR)/include -D__ARCH__=$(ARCH) include $(ARCH_DIR)/arch.mk # The architecture defines build targets, no more is required +endif + +# Target to remove build artifacts +clean: + rm -rf build