Simplify build system mandatory parameter/variable sanity checks.
[pub/lufa.git] / LUFA / Build / lufa.dfu.in
index ac5edea..8c478db 100644 (file)
@@ -37,15 +37,13 @@ LUFA_BUILD_OPTIONAL_VARS  +=
 # -----------------------------------------------------------------------------\r
 \r
 # Output Messages\r
-MSG_DFU_CMD   = '  [DFU]     :'\r
+MSG_COPY_CMD    = ' [CP]      :'\r
+MSG_REMOVE_CMD  = ' [RM]      :'\r
+MSG_DFU_CMD     = ' [DFU]     :'\r
 \r
 # Sanity check the user MCU and TARGET makefile options\r
-ifeq ($(MCU),)\r
-   $(error Makefile MCU value not set.)\r
-endif\r
-ifeq ($(TARGET),)\r
-   $(error Makefile TARGET value not set.)\r
-endif\r
+MCU            ?= $(error Makefile MCU value not set.)\r
+TARGET         ?= $(error Makefile TARGET value not set.)\r
 \r
 flip: $(TARGET).hex\r
        @echo $(MSG_DFU_CMD) Programming FLASH with batchisp using \"$(TARGET).hex\"\r
@@ -54,11 +52,13 @@ flip: $(TARGET).hex
        batchisp -hardware usb -device $(MCU) -operation start reset 0\r
 \r
 flip-ee: $(TARGET).eep\r
+       @echo $(MSG_DFU_CMD) Copying EEP file to temporary file \"$(TARGET)eep.hex\"\r
        cp $(TARGET).eep $(TARGET)eep.hex\r
        @echo $(MSG_DFU_CMD) Programming EEPROM with batchisp using \"$(TARGET).eep\"\r
        batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
        batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
        batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       @echo $(MSG_DFU_CMD) Removing temporary file \"$(TARGET)eep.hex\"\r
        rm $(TARGET)eep.hex\r
        \r
 dfu: $(TARGET).hex\r