Skip to content

Commit 8933f93

Browse files
committed
simplify and use columns for boardlist
1 parent 36c4cc7 commit 8933f93

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

ports/atmel-samd/Makefile

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,20 @@
2323
# THE SOFTWARE.
2424

2525
# Select the board to build for.
26-
define boardlist
27-
28-
$(foreach dir,$(filter-out %.*,$(wildcard boards/*)),$(notdir $(dir)))
29-
30-
26+
define show_board_error
27+
boardlist =
28+
$(info Valid boards:)
29+
$(shell printf '%s\n' $(patsubst boards/%/mpconfigboard.mk,%,$(wildcard boards/*/mpconfigboard.mk)) | column -xc $$(tput cols || echo 80) 1>&2)
30+
$(error Rerun with $(MAKE) BOARD=<board>)
3131
endef
3232

3333
ifeq ($(BOARD),)
34-
$(error You must provide a BOARD parameter: $(boardlist)Rerun with $(MAKE) BOARD=<board>)
34+
$(info No BOARD specified)
35+
$(call show_board_error)
3536
else
3637
ifeq ($(wildcard boards/$(BOARD)/.),)
37-
$(error Invalid BOARD specified)
38+
$(info Invalid BOARD specified)
39+
$(call show_board_error)
3840
endif
3941
endif
4042

0 commit comments

Comments
 (0)