mirror of
https://github.com/qmk/qmk_firmware.git
synced 2026-10-20 08:00:37 +02:00
Change the build system build module makefiles to have a set of sanity check macros they can call to verify user data. Add additional sanity checks.
This commit is contained in:
@@ -35,13 +35,14 @@ LUFA_BUILD_OPTIONAL_VARS +=
|
||||
#
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
# Sanity-check values of mandatory user-supplied variables
|
||||
ARCH ?= $(error Makefile ARCH value not set)
|
||||
LUFA_PATH ?= $(error Makefile LUFA_PATH value not set)
|
||||
ERROR_IF_UNSET = $(if $(filter undefined, $(origin $(strip $(1)))), $(error Makefile $(strip $(1)) value not set))
|
||||
ERROR_IF_EMPTY = $(if $(strip $($(strip $(1)))), , $(error Makefile $(strip $(1)) option cannot be blank))
|
||||
ERROR_IF_NONBOOL = $(if $(filter Y N, $($(strip $(1)))), , $(error Makefile $(strip $(1)) option must be Y or N))
|
||||
|
||||
ifeq ($(ARCH),)
|
||||
$(error Makefile ARCH option cannot be blank)
|
||||
endif
|
||||
# Sanity check user supplied values
|
||||
$(foreach MANDATORY_VAR, $(LUFA_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
|
||||
$(call ERROR_IF_EMPTY, LUFA_PATH)
|
||||
$(call ERROR_IF_EMPTY, ARCH)
|
||||
|
||||
# Allow LUFA_ROOT_PATH to be overridden elsewhere to support legacy LUFA makefiles
|
||||
LUFA_ROOT_PATH ?= $(patsubst %/,%,$(LUFA_PATH))
|
||||
|
||||
Reference in New Issue
Block a user