Fix up non-relative header file include paths (thanks to Kim Blomqvist).
[pub/lufa.git] / LUFA / Build / lufa.dfu.in
index 8122bfd..ba75f14 100644 (file)
@@ -6,10 +6,12 @@
 #           www.lufa-lib.org
 #
 
-LUFA_BUILD_MODULES        += DFU
-LUFA_BUILD_TARGETS        += flip flip-ee dfu dfu-ee
-LUFA_BUILD_MANDATORY_VARS += MCU TARGET
-LUFA_BUILD_OPTIONAL_VARS  += 
+LUFA_BUILD_MODULES         += DFU
+LUFA_BUILD_TARGETS         += flip flip-ee dfu dfu-ee
+LUFA_BUILD_MANDATORY_VARS  += MCU TARGET
+LUFA_BUILD_OPTIONAL_VARS   += 
+LUFA_BUILD_PROVIDED_VARS   += 
+LUFA_BUILD_PROVIDED_MACROS += 
 
 # -----------------------------------------------------------------------------
 #               LUFA DFU Bootloader Buildsystem Makefile Module.
@@ -34,18 +36,26 @@ LUFA_BUILD_OPTIONAL_VARS  +=
 #
 #    (None)
 #
+# PROVIDED VARIABLES:
+#
+#    (None)
+#
+# PROVIDED MACROS:
+#
+#    (None)
+#
 # -----------------------------------------------------------------------------
 
-# Sanity-check values of mandatory user-supplied variables
-MCU            ?= $(error Makefile MCU value not set)
-TARGET         ?= $(error Makefile TARGET value not set)
+SHELL = /bin/sh
 
-ifeq ($(MCU),)
-   $(error Makefile MCU option cannot be blank)
-endif
-ifeq ($(TARGET),)
-   $(error Makefile TARGET option cannot be blank)
-endif
+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))
+
+# Sanity-check values of mandatory user-supplied variables
+$(foreach MANDATORY_VAR, $(LUFA_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
+$(call ERROR_IF_EMPTY, MCU)
+$(call ERROR_IF_EMPTY, TARGET)
 
 # Output Messages
 MSG_COPY_CMD   := ' [CP]      :'