From 4627cc9c8f00860a1e845de27b8e81b6035ac0fd Mon Sep 17 00:00:00 2001 From: rusefi Date: Sat, 20 Apr 2019 21:44:00 -0400 Subject: [PATCH] Try ccache #769 --- firmware/bootloader/src/Makefile | 11 +++++++++-- unit_tests/Makefile | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/firmware/bootloader/src/Makefile b/firmware/bootloader/src/Makefile index 4d4938f796..fafb81e920 100644 --- a/firmware/bootloader/src/Makefile +++ b/firmware/bootloader/src/Makefile @@ -41,6 +41,13 @@ ifeq ($(USE_LINK_GC),) USE_LINK_GC = yes endif +ifeq ($(CCACHE_DIR),) + $(info No CCACHE_DIR) +else + $(info CCACHE_DIR is ${CCACHE_DIR}) + CCPREFIX=ccache +endif + # Linker extra options here. ifeq ($(USE_LDOPT),) USE_LDOPT = @@ -274,8 +281,8 @@ MCU = cortex-m4 #TRGT = arm-elf- TRGT = arm-none-eabi- -CC = $(TRGT)gcc -CPPC = $(TRGT)g++ +CC = $(CCPREFIX) $(TRGT)gcc +CPPC = $(CCPREFIX) $(TRGT)g++ # Enable loading with g++ only if you need C++ runtime support. # NOTE: You can use C++ even without C++ support if you are careful. C++ # runtime support makes code size explode. diff --git a/unit_tests/Makefile b/unit_tests/Makefile index fd9a24a4c8..592f451c3e 100644 --- a/unit_tests/Makefile +++ b/unit_tests/Makefile @@ -15,6 +15,13 @@ ifeq ($(USE_OPT),) USE_OPT = -c -Wall -O0 -ggdb -g3 -Werror=missing-field-initializers endif +ifeq ($(CCACHE_DIR),) + $(info No CCACHE_DIR) +else + $(info CCACHE_DIR is ${CCACHE_DIR}) + CCPREFIX=ccache +endif + # C specific options here (added to USE_OPT). ifeq ($(USE_COPT),) USE_COPT = -std=gnu99 -fgnu89-inline @@ -189,8 +196,8 @@ else TRGT = endif -CC = $(TRGT)gcc -CPPC = $(TRGT)g++ +CC = $(CCPREFIX) $(TRGT)gcc +CPPC = $(CCPREFIX) $(TRGT)g++ # Enable loading with g++ only if you need C++ runtime support. # NOTE: You can use C++ even without C++ support if you are careful. C++ # runtime support makes code size explode.