summaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
authorFlorian Didron <fdidron@users.noreply.github.com>2019-05-06 10:35:24 +0900
committerGitHub <noreply@github.com>2019-05-06 10:35:24 +0900
commit270ab0d3fb6a85cee797c6e75ac87ce295c038a8 (patch)
treeaf78ff21a685eb7e9eb1d372aee43abcf9143618 /tmk_core
parent4f2efc06cec72205d1e14eee38f3124e25e18e23 (diff)
parent43aae47b383fe2490112d5ee9180d6978ff2a177 (diff)
Merge branch 'master' into feature/unicode_map_improvements
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/chibios.mk5
-rw-r--r--tmk_core/common.mk7
2 files changed, 12 insertions, 0 deletions
diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk
index 01edebfd74..44c00bdd15 100644
--- a/tmk_core/chibios.mk
+++ b/tmk_core/chibios.mk
@@ -201,6 +201,7 @@ DFU_ARGS ?=
ifneq ("$(SERIAL)","")
DFU_ARGS += -S $(SERIAL)
endif
+DFU_SUFFIX_ARGS ?=
ST_LINK_ARGS ?=
@@ -208,6 +209,7 @@ 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
@@ -259,4 +261,7 @@ st-link-cli: $(BUILD_DIR)/$(TARGET).hex sizeafter
$(ST_LINK_CLI) $(ST_LINK_ARGS) -q -c SWD -p $(BUILD_DIR)/$(TARGET).hex -Rst
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/common.mk b/tmk_core/common.mk
index 94f3c2380d..2216887555 100644
--- a/tmk_core/common.mk
+++ b/tmk_core/common.mk
@@ -208,6 +208,13 @@ ifeq ($(strip $(SHARED_EP_ENABLE)), yes)
TMK_COMMON_DEFS += -DSHARED_EP_ENABLE
endif
+
+ifeq ($(strip $(LINK_TIME_OPTIMIZATION_ENABLE)), yes)
+ EXTRAFLAGS += -flto
+ TMK_COMMON_DEFS += -DLINK_TIME_OPTIMIZATION_ENABLE
+ TMK_COMMON_DEFS += -DNO_ACTION_MACRO
+ TMK_COMMON_DEFS += -DNO_ACTION_FUNCTION
+endif
# Bootloader address
ifdef STM32_BOOTLOADER_ADDRESS
TMK_COMMON_DEFS += -DSTM32_BOOTLOADER_ADDRESS=$(STM32_BOOTLOADER_ADDRESS)