summaryrefslogtreecommitdiff
path: root/tmk_core/rules.mk
diff options
context:
space:
mode:
authorskullydazed <skullydazed@users.noreply.github.com>2019-07-07 09:08:49 -0700
committerFlorian Didron <fdidron@users.noreply.github.com>2019-07-10 09:06:19 +0900
commitea40d07776a0c0f2cb195336cf7bdc0d12dc958b (patch)
tree4cacfc7c79abd3ba9651b5d49f106758abc65ed4 /tmk_core/rules.mk
parent3e7e8a3d9f0b318c955c59c22d7d8c16f49618aa (diff)
Fix chibios so the dfu-suffix is only applied once. (#6270)
Diffstat (limited to 'tmk_core/rules.mk')
-rw-r--r--tmk_core/rules.mk8
1 files changed, 8 insertions, 0 deletions
diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk
index 6d2bb51f07..8f876a383c 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