From b36e0c66581b5ec0e3aff5212857e9694115e66c Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Thu, 21 Oct 2021 14:39:13 +0100 Subject: [PATCH] Move USE_CCACHE logic to common location (#14899) --- tmk_core/arm_atsam.mk | 2 +- tmk_core/avr.mk | 2 +- tmk_core/chibios.mk | 6 ------ tmk_core/native.mk | 2 +- tmk_core/rules.mk | 7 +++++-- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/tmk_core/arm_atsam.mk b/tmk_core/arm_atsam.mk index b29de9132b..b49bf764d7 100644 --- a/tmk_core/arm_atsam.mk +++ b/tmk_core/arm_atsam.mk @@ -2,7 +2,7 @@ ############################################################################## # Compiler settings # -CC = arm-none-eabi-gcc +CC = $(CC_PREFIX) arm-none-eabi-gcc OBJCOPY = arm-none-eabi-objcopy OBJDUMP = arm-none-eabi-objdump SIZE = arm-none-eabi-size diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk index 940e95397b..c52262273e 100644 --- a/tmk_core/avr.mk +++ b/tmk_core/avr.mk @@ -2,7 +2,7 @@ ############################################################################## # Compiler settings # -CC = avr-gcc +CC = $(CC_PREFIX) avr-gcc OBJCOPY = avr-objcopy OBJDUMP = avr-objdump SIZE = avr-size diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk index c520d6025b..957a259229 100644 --- a/tmk_core/chibios.mk +++ b/tmk_core/chibios.mk @@ -398,12 +398,6 @@ OPT_DEFS += -DPROTOCOL_CHIBIOS # Workaround to stop ChibiOS from complaining about new GCC -- it's been fixed for 7/8/9 already OPT_DEFS += -DPORT_IGNORE_GCC_VERSION_CHECK=1 -# Speed up recompilations by opt-in usage of ccache -USE_CCACHE ?= no -ifneq ($(USE_CCACHE),no) - CC_PREFIX ?= ccache -endif - # Construct GCC toolchain CC = $(CC_PREFIX) $(TOOLCHAIN)gcc OBJCOPY = $(TOOLCHAIN)objcopy diff --git a/tmk_core/native.mk b/tmk_core/native.mk index f609fd0e6f..eb2424ec5c 100644 --- a/tmk_core/native.mk +++ b/tmk_core/native.mk @@ -1,7 +1,7 @@ SYSTEM_TYPE := $(shell gcc -dumpmachine) GCC_VERSION := $(shell gcc --version 2>/dev/null) -CC = gcc +CC = $(CC_PREFIX) gcc OBJCOPY = OBJDUMP = SIZE = diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index 5a629d1eb0..4c547cfd24 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 ?= yes +ifneq ($(USE_CCACHE),no) + CC_PREFIX ?= ccache +endif #---------------- Compiler Options C ---------------- # -g*: generate debugging information