Skip to content

Commit e2a3597

Browse files
microdev1rhooperjepler
committed
add awesome new make error message
Copied from initial implementation on atmel-samd Co-authored-by: Rose Hooper <[email protected]> Co-authored-by: Jeff Epler <[email protected]>
1 parent 8933f93 commit e2a3597

File tree

8 files changed

+89
-22
lines changed

8 files changed

+89
-22
lines changed

ports/broadcom/Makefile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
# Select the board to build for.
2-
BOARD?=raspberrypi_pi4b
2+
define show_board_error
3+
boardlist =
4+
$(info Valid boards:)
5+
$(shell printf '%s\n' $(patsubst boards/%/mpconfigboard.mk,%,$(wildcard boards/*/mpconfigboard.mk)) | column -xc $$(tput cols || echo 80) 1>&2)
6+
$(error Rerun with $(MAKE) BOARD=<board>)
7+
endef
38

49
ifeq ($(BOARD),)
5-
$(error You must provide a BOARD parameter)
10+
$(info No BOARD specified)
11+
$(call show_board_error)
612
else
713
ifeq ($(wildcard boards/$(BOARD)/.),)
8-
$(error Invalid BOARD "$(BOARD)" specified)
14+
$(info Invalid BOARD specified)
15+
$(call show_board_error)
916
endif
1017
endif
1118

ports/cxd56/Makefile

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

2525
# Select the board to build for.
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>)
31+
endef
32+
2633
ifeq ($(BOARD),)
27-
$(error You must provide a BOARD parameter)
34+
$(info No BOARD specified)
35+
$(call show_board_error)
2836
else
2937
ifeq ($(wildcard boards/$(BOARD)/.),)
30-
$(error Invalid BOARD specified)
38+
$(info Invalid BOARD specified)
39+
$(call show_board_error)
3140
endif
3241
endif
3342

ports/espressif/Makefile

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

2525
# Select the board to build for.
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>)
31+
endef
32+
2633
ifeq ($(BOARD),)
27-
$(error You must provide a BOARD parameter)
34+
$(info No BOARD specified)
35+
$(call show_board_error)
2836
else
2937
ifeq ($(wildcard boards/$(BOARD)/.),)
30-
$(error Invalid BOARD specified)
38+
$(info Invalid BOARD specified)
39+
$(call show_board_error)
3140
endif
3241
endif
3342

ports/litex/Makefile

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

2525
# Select the board to build for.
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>)
31+
endef
32+
2633
ifeq ($(BOARD),)
27-
$(error You must provide a BOARD parameter)
34+
$(info No BOARD specified)
35+
$(call show_board_error)
2836
else
2937
ifeq ($(wildcard boards/$(BOARD)/.),)
30-
$(error Invalid BOARD specified)
38+
$(info Invalid BOARD specified)
39+
$(call show_board_error)
3140
endif
3241
endif
3342

ports/mimxrt10xx/Makefile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,20 @@
2424
# THE SOFTWARE.
2525

2626
# Select the board to build for.
27+
define show_board_error
28+
boardlist =
29+
$(info Valid boards:)
30+
$(shell printf '%s\n' $(patsubst boards/%/mpconfigboard.mk,%,$(wildcard boards/*/mpconfigboard.mk)) | column -xc $$(tput cols || echo 80) 1>&2)
31+
$(error Rerun with $(MAKE) BOARD=<board>)
32+
endef
33+
2734
ifeq ($(BOARD),)
28-
$(error You must provide a BOARD parameter)
35+
$(info No BOARD specified)
36+
$(call show_board_error)
2937
else
3038
ifeq ($(wildcard boards/$(BOARD)/.),)
31-
$(error Invalid BOARD specified)
39+
$(info Invalid BOARD specified)
40+
$(call show_board_error)
3241
endif
3342
endif
3443

ports/nrf/Makefile

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,20 @@
2323
# THE SOFTWARE.
2424

2525
# Select the board to build for.
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>)
31+
endef
32+
2633
ifeq ($(BOARD),)
27-
$(info You must provide a BOARD parameter with 'BOARD=')
28-
$(info Possible values are:)
29-
$(info $(sort $(subst /.,,$(subst boards/,,$(wildcard boards/*/.)))))
30-
$(error BOARD not defined)
34+
$(info No BOARD specified)
35+
$(call show_board_error)
3136
else
3237
ifeq ($(wildcard boards/$(BOARD)/.),)
33-
$(error Invalid BOARD specified)
38+
$(info Invalid BOARD specified)
39+
$(call show_board_error)
3440
endif
3541
endif
3642

ports/raspberrypi/Makefile

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

2525
# Select the board to build for.
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>)
31+
endef
32+
2633
ifeq ($(BOARD),)
27-
$(error You must provide a BOARD parameter)
34+
$(info No BOARD specified)
35+
$(call show_board_error)
2836
else
2937
ifeq ($(wildcard boards/$(BOARD)/.),)
30-
$(error Invalid BOARD specified)
38+
$(info Invalid BOARD specified)
39+
$(call show_board_error)
3140
endif
3241
endif
3342

ports/stm/Makefile

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,21 @@
2424
# THE SOFTWARE.
2525

2626
# Select the board to build for.
27+
define show_board_error
28+
boardlist =
29+
$(info Valid boards:)
30+
$(shell printf '%s\n' $(patsubst boards/%/mpconfigboard.mk,%,$(wildcard boards/*/mpconfigboard.mk)) | column -xc $$(tput cols || echo 80) 1>&2)
31+
$(error Rerun with $(MAKE) BOARD=<board>)
32+
endef
33+
2734
ifeq ($(BOARD),)
28-
$(error You must provide a BOARD parameter)
35+
$(info No BOARD specified)
36+
$(call show_board_error)
2937
else
30-
ifeq ($(wildcard boards/$(BOARD)/.),)
31-
$(error Invalid BOARD specified)
32-
endif
38+
ifeq ($(wildcard boards/$(BOARD)/.),)
39+
$(info Invalid BOARD specified)
40+
$(call show_board_error)
41+
endif
3342
endif
3443

3544
# If the build directory is not given, make it reflect the board name.

0 commit comments

Comments
 (0)