]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Always copy the firmware file to the root qmk_firmware directory (#2314)
authorskullydazed <skullydazed@users.noreply.github.com>
Sun, 28 Jan 2018 19:11:28 +0000 (11:11 -0800)
committerGitHub <noreply@github.com>
Sun, 28 Jan 2018 19:11:28 +0000 (11:11 -0800)
* Always copy the firmware file to the root qmk_firmware directory

* remove circular dependency

build_keyboard.mk
tmk_core/avr.mk
tmk_core/chibios.mk
tmk_core/rules.mk

index cbdaaa01043eccf587a9d87c2696c00b506bfece..bee8fcc8748a0a142bf1392632ee66b65ed203dd 100644 (file)
@@ -113,9 +113,11 @@ endif
 
 # We can assume a ChibiOS target When MCU_FAMILY is defined , since it's not used for LUFA
 ifdef MCU_FAMILY
+    FIRMWARE_FORMAT=bin
     PLATFORM=CHIBIOS
 else
     PLATFORM=AVR
+    FIRMWARE_FORMAT=hex
 endif
 
 ifeq ($(PLATFORM),CHIBIOS)
@@ -270,7 +272,7 @@ $(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG)
 all: build check-size
 
 # Change the build target to build a HEX file or a library.
-build: elf cphex
+build: elf cpfirmware
 #build: elf hex eep lss sym
 #build: lib
 
index 30d4fe26ee46f7c39fa00ccdb096fa5b308c61ba..24722736ee9f1ed3662cc48f0790d79f0df6eda9 100644 (file)
@@ -136,7 +136,7 @@ flip: $(BUILD_DIR)/$(TARGET).hex check-size
        
 DFU_PROGRAMMER ?= dfu-programmer
 
-dfu: $(BUILD_DIR)/$(TARGET).hex check-size
+dfu: $(BUILD_DIR)/$(TARGET).hex cpfirmware check-size
        until $(DFU_PROGRAMMER) $(MCU) get bootloader-version; do\
                echo "Error: Bootloader not found. Trying again in 5s." ;\
                sleep 5 ;\
index cb0482d757d468b1d23724d5c4a77a36b22a7bf5..df9fa849811868a38d8e457d77a0f6d025ba0f77 100644 (file)
@@ -220,7 +220,7 @@ qmk: $(BUILD_DIR)/$(TARGET).bin
        zip $(TARGET).qmk -urj $(BUILD_DIR)/$(TARGET).json
        printf "@ $(TARGET).json\n@=info.json\n" | zipnote -w $(TARGET).qmk
 
-dfu-util: $(BUILD_DIR)/$(TARGET).bin sizeafter
+dfu-util: $(BUILD_DIR)/$(TARGET).bin cpfirmware sizeafter
        $(DFU_UTIL) $(DFU_ARGS) -D $(BUILD_DIR)/$(TARGET).bin
 
 bin: $(BUILD_DIR)/$(TARGET).bin sizeafter
index 920a7f6add8c950a363a0367e29bebdb1438c979..7a282caccd3ee07f7cdaa40d34e1d4f8a16dcd66 100644 (file)
@@ -216,9 +216,9 @@ MOVE_DEP = mv -f $(patsubst %.o,%.td,$@) $(patsubst %.o,%.d,$@)
 
 elf: $(BUILD_DIR)/$(TARGET).elf
 hex: $(BUILD_DIR)/$(TARGET).hex
-cphex: hex
-       $(SILENT) || printf "Copying $(TARGET).hex to qmk_firmware folder" | $(AWK_CMD)
-       $(COPY) $(BUILD_DIR)/$(TARGET).hex $(TARGET).hex && $(PRINT_OK)
+cpfirmware: $(FIRMWARE_FORMAT)
+       $(SILENT) || printf "Copying $(TARGET).$(FIRMWARE_FORMAT) to qmk_firmware folder" | $(AWK_CMD)
+       $(COPY) $(BUILD_DIR)/$(TARGET).$(FIRMWARE_FORMAT) $(TARGET).$(FIRMWARE_FORMAT) && $(PRINT_OK)
 eep: $(BUILD_DIR)/$(TARGET).eep
 lss: $(BUILD_DIR)/$(TARGET).lss
 sym: $(BUILD_DIR)/$(TARGET).sym
@@ -392,4 +392,4 @@ $(eval $(foreach OUTPUT,$(OUTPUTS),$(shell mkdir -p $(OUTPUT) 2>/dev/null)))
 .PHONY : all finish sizebefore sizeafter qmkversion \
 gccversion build elf hex eep lss sym coff extcoff \
 clean clean_list debug gdb-config show_path \
-program teensy dfu flip dfu-ee flip-ee dfu-start
\ No newline at end of file
+program teensy dfu flip dfu-ee flip-ee dfu-start