Skip to content

Commit 9bfaf66

Browse files
authored
Always copy the firmware file to the root qmk_firmware directory (qmk#2314)
* Always copy the firmware file to the root qmk_firmware directory * remove circular dependency
1 parent f0f991d commit 9bfaf66

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

build_keyboard.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,11 @@ endif
113113

114114
# We can assume a ChibiOS target When MCU_FAMILY is defined , since it's not used for LUFA
115115
ifdef MCU_FAMILY
116+
FIRMWARE_FORMAT=bin
116117
PLATFORM=CHIBIOS
117118
else
118119
PLATFORM=AVR
120+
FIRMWARE_FORMAT=hex
119121
endif
120122

121123
ifeq ($(PLATFORM),CHIBIOS)
@@ -270,7 +272,7 @@ $(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG)
270272
all: build check-size
271273

272274
# Change the build target to build a HEX file or a library.
273-
build: elf cphex
275+
build: elf cpfirmware
274276
#build: elf hex eep lss sym
275277
#build: lib
276278

tmk_core/avr.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ flip: $(BUILD_DIR)/$(TARGET).hex check-size
136136

137137
DFU_PROGRAMMER ?= dfu-programmer
138138

139-
dfu: $(BUILD_DIR)/$(TARGET).hex check-size
139+
dfu: $(BUILD_DIR)/$(TARGET).hex cpfirmware check-size
140140
until $(DFU_PROGRAMMER) $(MCU) get bootloader-version; do\
141141
echo "Error: Bootloader not found. Trying again in 5s." ;\
142142
sleep 5 ;\

tmk_core/chibios.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ qmk: $(BUILD_DIR)/$(TARGET).bin
220220
zip $(TARGET).qmk -urj $(BUILD_DIR)/$(TARGET).json
221221
printf "@ $(TARGET).json\n@=info.json\n" | zipnote -w $(TARGET).qmk
222222

223-
dfu-util: $(BUILD_DIR)/$(TARGET).bin sizeafter
223+
dfu-util: $(BUILD_DIR)/$(TARGET).bin cpfirmware sizeafter
224224
$(DFU_UTIL) $(DFU_ARGS) -D $(BUILD_DIR)/$(TARGET).bin
225225

226226
bin: $(BUILD_DIR)/$(TARGET).bin sizeafter

tmk_core/rules.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,9 @@ MOVE_DEP = mv -f $(patsubst %.o,%.td,$@) $(patsubst %.o,%.d,$@)
216216

217217
elf: $(BUILD_DIR)/$(TARGET).elf
218218
hex: $(BUILD_DIR)/$(TARGET).hex
219-
cphex: hex
220-
$(SILENT) || printf "Copying $(TARGET).hex to qmk_firmware folder" | $(AWK_CMD)
221-
$(COPY) $(BUILD_DIR)/$(TARGET).hex $(TARGET).hex && $(PRINT_OK)
219+
cpfirmware: $(FIRMWARE_FORMAT)
220+
$(SILENT) || printf "Copying $(TARGET).$(FIRMWARE_FORMAT) to qmk_firmware folder" | $(AWK_CMD)
221+
$(COPY) $(BUILD_DIR)/$(TARGET).$(FIRMWARE_FORMAT) $(TARGET).$(FIRMWARE_FORMAT) && $(PRINT_OK)
222222
eep: $(BUILD_DIR)/$(TARGET).eep
223223
lss: $(BUILD_DIR)/$(TARGET).lss
224224
sym: $(BUILD_DIR)/$(TARGET).sym
@@ -392,4 +392,4 @@ $(eval $(foreach OUTPUT,$(OUTPUTS),$(shell mkdir -p $(OUTPUT) 2>/dev/null)))
392392
.PHONY : all finish sizebefore sizeafter qmkversion \
393393
gccversion build elf hex eep lss sym coff extcoff \
394394
clean clean_list debug gdb-config show_path \
395-
program teensy dfu flip dfu-ee flip-ee dfu-start
395+
program teensy dfu flip dfu-ee flip-ee dfu-start

0 commit comments

Comments
 (0)