From 8933f93439b10a7402f2c962bd5742b7902f1e38 Mon Sep 17 00:00:00 2001 From: Rose Hooper Date: Tue, 1 Nov 2022 11:00:48 -0400 Subject: [PATCH] simplify and use columns for boardlist --- ports/atmel-samd/Makefile | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index fce68d4d41..d27a048399 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -23,18 +23,20 @@ # THE SOFTWARE. # Select the board to build for. -define boardlist - -$(foreach dir,$(filter-out %.*,$(wildcard boards/*)),$(notdir $(dir))) - - +define show_board_error +boardlist = +$(info Valid boards:) +$(shell printf '%s\n' $(patsubst boards/%/mpconfigboard.mk,%,$(wildcard boards/*/mpconfigboard.mk)) | column -xc $$(tput cols || echo 80) 1>&2) +$(error Rerun with $(MAKE) BOARD=) endef ifeq ($(BOARD),) - $(error You must provide a BOARD parameter: $(boardlist)Rerun with $(MAKE) BOARD=) + $(info No BOARD specified) + $(call show_board_error) else ifeq ($(wildcard boards/$(BOARD)/.),) - $(error Invalid BOARD specified) + $(info Invalid BOARD specified) + $(call show_board_error) endif endif