From 75795186135e6d83de1ff3bb108f9c5471742ba4 Mon Sep 17 00:00:00 2001 From: skullydazed Date: Sun, 7 Jul 2019 09:08:49 -0700 Subject: [PATCH] Fix chibios so the dfu-suffix is only applied once. (#6270) --- tmk_core/chibios.mk | 6 ------ tmk_core/rules.mk | 8 ++++++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk index 11715cf34..4aebb4776 100644 --- a/tmk_core/chibios.mk +++ b/tmk_core/chibios.mk @@ -201,7 +201,6 @@ DFU_ARGS ?= ifneq ("$(SERIAL)","") DFU_ARGS += -S $(SERIAL) endif -DFU_SUFFIX_ARGS ?= ST_LINK_ARGS ?= @@ -209,7 +208,6 @@ ST_LINK_ARGS ?= EXTRALIBDIRS = $(RULESPATH)/ld DFU_UTIL ?= dfu-util -DFU_SUFFIX ?= dfu-suffix ST_LINK_CLI ?= st-link_cli # Generate a .qmk for the QMK-FF @@ -274,7 +272,3 @@ teensy: $(BUILD_DIR)/$(TARGET).hex cpfirmware sizeafter $(TEENSY_LOADER_CLI) -mmcu=$(MCU_LDSCRIPT) -w -v $(BUILD_DIR)/$(TARGET).hex bin: $(BUILD_DIR)/$(TARGET).bin sizeafter - if [ ! -z "$(DFU_SUFFIX_ARGS)" ]; then \ - $(DFU_SUFFIX) $(DFU_SUFFIX_ARGS) -a $(BUILD_DIR)/$(TARGET).bin 1>/dev/null ;\ - fi - $(COPY) $(BUILD_DIR)/$(TARGET).bin $(TARGET).bin; diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index 6d2bb51f0..8f876a383 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -223,6 +223,10 @@ $(foreach LOBJ, $(NO_LTO_OBJ), $(eval $(call NO_LTO,$(LOBJ)))) MOVE_DEP = mv -f $(patsubst %.o,%.td,$@) $(patsubst %.o,%.d,$@) +# Add QMK specific flags +DFU_SUFFIX ?= dfu-suffix +DFU_SUFFIX_ARGS ?= + elf: $(BUILD_DIR)/$(TARGET).elf hex: $(BUILD_DIR)/$(TARGET).hex @@ -279,6 +283,10 @@ gccversion : @$(SILENT) || printf "$(MSG_BIN) $@" | $(AWK_CMD) $(eval CMD=$(BIN) $< $@ || exit 0) @$(BUILD_CMD) + if [ ! -z "$(DFU_SUFFIX_ARGS)" ]; then \ + $(DFU_SUFFIX) $(DFU_SUFFIX_ARGS) -a $(BUILD_DIR)/$(TARGET).bin 1>/dev/null ;\ + fi + $(COPY) $(BUILD_DIR)/$(TARGET).bin $(TARGET).bin; BEGIN = gccversion sizebefore