Rename program_ee AVRDUDE module target to program-ee. Update CORE build module to...
[pub/lufa.git] / LUFA / Build / lufa.dfu.in
index f04472e..f855bf7 100644 (file)
@@ -6,8 +6,10 @@
 #           www.lufa-lib.org\r
 #\r
 \r
-LUFA_BUILD_MODULES += DFU\r
-LUFA_BUILD_TARGETS += flip flip-ee dfu dfu-ee\r
+LUFA_BUILD_MODULES        += DFU\r
+LUFA_BUILD_TARGETS        += flip flip-ee dfu dfu-ee\r
+LUFA_BUILD_MANDATORY_VARS += MCU TARGET\r
+LUFA_BUILD_OPTIONAL_VARS  += \r
 \r
 # -----------------------------------------------------------------------------\r
 #               LUFA DFU Bootloader Buildsystem Makefile Module.\r
@@ -34,16 +36,14 @@ LUFA_BUILD_TARGETS += flip flip-ee dfu dfu-ee
 #\r
 # -----------------------------------------------------------------------------\r
 \r
-# Output Messages\r
-MSG_DFU_CMD   = '  [DFU]     :'\r
+# Sanity-check values of mandatory user-supplied variables\r
+MCU            ?= $(error Makefile MCU value not set.)\r
+TARGET         ?= $(error Makefile TARGET value not set.)\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
+# Output Messages\r
+MSG_COPY_CMD   := ' [CP]      :'\r
+MSG_REMOVE_CMD := ' [RM]      :'\r
+MSG_DFU_CMD    := ' [DFU]     :'\r
 \r
 flip: $(TARGET).hex\r
        @echo $(MSG_DFU_CMD) Programming FLASH with batchisp using \"$(TARGET).hex\"\r
@@ -52,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