summaryrefslogtreecommitdiff
path: root/tmk_core/rules.mk
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/rules.mk')
-rw-r--r--tmk_core/rules.mk16
1 files changed, 14 insertions, 2 deletions
diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk
index 5a629d1eb0..b17f85d375 100644
--- a/tmk_core/rules.mk
+++ b/tmk_core/rules.mk
@@ -69,8 +69,11 @@ CSTANDARD = -std=gnu99
#CXXDEFS += -D__STDC_CONSTANT_MACROS
#CXXDEFS +=
-
-
+# Speed up recompilations by opt-in usage of ccache
+USE_CCACHE ?= no
+ifneq ($(USE_CCACHE),no)
+ CC_PREFIX ?= ccache
+endif
#---------------- Compiler Options C ----------------
# -g*: generate debugging information
@@ -79,6 +82,15 @@ CSTANDARD = -std=gnu99
# -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