aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Build/lufa.dfu.in
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2012-06-10 08:06:13 +0000
committerDean Camera <dean@fourwalledcubicle.com>2012-06-10 08:06:13 +0000
commit53be52922fa690b57fcfdd2ea531f876516b3b67 (patch)
tree613bd3df574e5a20062483496512540e42c1ddfd /LUFA/Build/lufa.dfu.in
parent3808f5c36d0ee183e9825e645cc984f1c6047ef5 (diff)
downloadlufa-53be52922fa690b57fcfdd2ea531f876516b3b67.tar.gz
lufa-53be52922fa690b57fcfdd2ea531f876516b3b67.tar.bz2
lufa-53be52922fa690b57fcfdd2ea531f876516b3b67.zip
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.
Diffstat (limited to 'LUFA/Build/lufa.dfu.in')
-rw-r--r--LUFA/Build/lufa.dfu.in18
1 files changed, 9 insertions, 9 deletions
diff --git a/LUFA/Build/lufa.dfu.in b/LUFA/Build/lufa.dfu.in
index 8122bfde3..9c05bb7c1 100644
--- a/LUFA/Build/lufa.dfu.in
+++ b/LUFA/Build/lufa.dfu.in
@@ -36,16 +36,16 @@ LUFA_BUILD_OPTIONAL_VARS +=
#
# -----------------------------------------------------------------------------
-# Sanity-check values of mandatory user-supplied variables
-MCU ?= $(error Makefile MCU value not set)
-TARGET ?= $(error Makefile TARGET 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 ($(MCU),)
- $(error Makefile MCU option cannot be blank)
-endif
-ifeq ($(TARGET),)
- $(error Makefile TARGET option cannot be blank)
-endif
+# Sanity-check values of mandatory user-supplied variables
+$(foreach MANDATORY_VAR, $(LUFA_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
+$(call ERROR_IF_UNSET, MCU)
+$(call ERROR_IF_UNSET, TARGET)
+$(call ERROR_IF_EMPTY, MCU)
+$(call ERROR_IF_EMPTY, TARGET)
# Output Messages
MSG_COPY_CMD := ' [CP] :'