add awesome new make error message

Copied from initial implementation on atmel-samd

Co-authored-by: Rose Hooper <rhooper@toybox.ca>
Co-authored-by: Jeff Epler <jepler@gmail.com>
This commit is contained in:
MicroDev 2022-11-18 11:27:23 +05:30
parent 8933f93439
commit e2a3597263
No known key found for this signature in database
GPG Key ID: 2C0867BE60967730
8 changed files with 89 additions and 22 deletions

View File

@ -1,11 +1,18 @@
# Select the board to build for. # Select the board to build for.
BOARD?=raspberrypi_pi4b 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=<board>)
endef
ifeq ($(BOARD),) ifeq ($(BOARD),)
$(error You must provide a BOARD parameter) $(info No BOARD specified)
$(call show_board_error)
else else
ifeq ($(wildcard boards/$(BOARD)/.),) ifeq ($(wildcard boards/$(BOARD)/.),)
$(error Invalid BOARD "$(BOARD)" specified) $(info Invalid BOARD specified)
$(call show_board_error)
endif endif
endif endif

View File

@ -23,11 +23,20 @@
# THE SOFTWARE. # THE SOFTWARE.
# Select the board to build for. # Select the board to build for.
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=<board>)
endef
ifeq ($(BOARD),) ifeq ($(BOARD),)
$(error You must provide a BOARD parameter) $(info No BOARD specified)
$(call show_board_error)
else else
ifeq ($(wildcard boards/$(BOARD)/.),) ifeq ($(wildcard boards/$(BOARD)/.),)
$(error Invalid BOARD specified) $(info Invalid BOARD specified)
$(call show_board_error)
endif endif
endif endif

View File

@ -23,11 +23,20 @@
# THE SOFTWARE. # THE SOFTWARE.
# Select the board to build for. # Select the board to build for.
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=<board>)
endef
ifeq ($(BOARD),) ifeq ($(BOARD),)
$(error You must provide a BOARD parameter) $(info No BOARD specified)
$(call show_board_error)
else else
ifeq ($(wildcard boards/$(BOARD)/.),) ifeq ($(wildcard boards/$(BOARD)/.),)
$(error Invalid BOARD specified) $(info Invalid BOARD specified)
$(call show_board_error)
endif endif
endif endif

View File

@ -23,11 +23,20 @@
# THE SOFTWARE. # THE SOFTWARE.
# Select the board to build for. # Select the board to build for.
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=<board>)
endef
ifeq ($(BOARD),) ifeq ($(BOARD),)
$(error You must provide a BOARD parameter) $(info No BOARD specified)
$(call show_board_error)
else else
ifeq ($(wildcard boards/$(BOARD)/.),) ifeq ($(wildcard boards/$(BOARD)/.),)
$(error Invalid BOARD specified) $(info Invalid BOARD specified)
$(call show_board_error)
endif endif
endif endif

View File

@ -24,11 +24,20 @@
# THE SOFTWARE. # THE SOFTWARE.
# Select the board to build for. # Select the board to build for.
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=<board>)
endef
ifeq ($(BOARD),) ifeq ($(BOARD),)
$(error You must provide a BOARD parameter) $(info No BOARD specified)
$(call show_board_error)
else else
ifeq ($(wildcard boards/$(BOARD)/.),) ifeq ($(wildcard boards/$(BOARD)/.),)
$(error Invalid BOARD specified) $(info Invalid BOARD specified)
$(call show_board_error)
endif endif
endif endif

View File

@ -23,14 +23,20 @@
# THE SOFTWARE. # THE SOFTWARE.
# Select the board to build for. # Select the board to build for.
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=<board>)
endef
ifeq ($(BOARD),) ifeq ($(BOARD),)
$(info You must provide a BOARD parameter with 'BOARD=') $(info No BOARD specified)
$(info Possible values are:) $(call show_board_error)
$(info $(sort $(subst /.,,$(subst boards/,,$(wildcard boards/*/.)))))
$(error BOARD not defined)
else else
ifeq ($(wildcard boards/$(BOARD)/.),) ifeq ($(wildcard boards/$(BOARD)/.),)
$(error Invalid BOARD specified) $(info Invalid BOARD specified)
$(call show_board_error)
endif endif
endif endif

View File

@ -23,11 +23,20 @@
# THE SOFTWARE. # THE SOFTWARE.
# Select the board to build for. # Select the board to build for.
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=<board>)
endef
ifeq ($(BOARD),) ifeq ($(BOARD),)
$(error You must provide a BOARD parameter) $(info No BOARD specified)
$(call show_board_error)
else else
ifeq ($(wildcard boards/$(BOARD)/.),) ifeq ($(wildcard boards/$(BOARD)/.),)
$(error Invalid BOARD specified) $(info Invalid BOARD specified)
$(call show_board_error)
endif endif
endif endif

View File

@ -24,12 +24,21 @@
# THE SOFTWARE. # THE SOFTWARE.
# Select the board to build for. # Select the board to build for.
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=<board>)
endef
ifeq ($(BOARD),) ifeq ($(BOARD),)
$(error You must provide a BOARD parameter) $(info No BOARD specified)
$(call show_board_error)
else else
ifeq ($(wildcard boards/$(BOARD)/.),) ifeq ($(wildcard boards/$(BOARD)/.),)
$(error Invalid BOARD specified) $(info Invalid BOARD specified)
endif $(call show_board_error)
endif
endif endif
# If the build directory is not given, make it reflect the board name. # If the build directory is not given, make it reflect the board name.