summaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/common.mk12
-rw-r--r--tmk_core/rules.mk9
2 files changed, 9 insertions, 12 deletions
diff --git a/tmk_core/common.mk b/tmk_core/common.mk
index f0faa2dc3e..ce335f0d3c 100644
--- a/tmk_core/common.mk
+++ b/tmk_core/common.mk
@@ -100,18 +100,6 @@ ifeq ($(strip $(SHARED_EP_ENABLE)), yes)
TMK_COMMON_DEFS += -DSHARED_EP_ENABLE
endif
-ifeq ($(strip $(LTO_ENABLE)), yes)
- ifeq ($(PLATFORM),CHIBIOS)
- $(info Enabling LTO on ChibiOS-targeting boards is known to have a high likelihood of failure.)
- $(info If unsure, set LTO_ENABLE = no.)
- endif
- EXTRAFLAGS += -flto
- TMK_COMMON_DEFS += -DLTO_ENABLE
- TMK_COMMON_DEFS += -DLINK_TIME_OPTIMIZATON_ENABLE
-else ifdef LINK_TIME_OPTIMIZATION_ENABLE
- $(error The LINK_TIME_OPTIMIZATION_ENABLE flag has been renamed to LTO_ENABLE.)
-endif
-
# Search Path
VPATH += $(TMK_PATH)/$(COMMON_DIR)
VPATH += $(TMK_PATH)/$(PLATFORM_COMMON_DIR)
diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk
index 56a331e288..b17f85d375 100644
--- a/tmk_core/rules.mk
+++ b/tmk_core/rules.mk
@@ -82,6 +82,15 @@ endif
# -Wall...: warning level
# -Wa,...: tell GCC to pass this to the assembler.
# -adhlns...: create assembler listing
+ifeq ($(strip $(LTO_ENABLE)), yes)
+ ifeq ($(PLATFORM),CHIBIOS)
+ $(info Enabling LTO on ChibiOS-targeting boards is known to have a high likelihood of failure.)
+ $(info If unsure, set LTO_ENABLE = no.)
+ endif
+ CDEFS += -flto
+ CDEFS += -DLTO_ENABLE
+endif
+
DEBUG_ENABLE ?= yes
ifeq ($(strip $(SKIP_DEBUG_INFO)),yes)
DEBUG_ENABLE=no