summaryrefslogtreecommitdiffstats
path: root/toolchain.inc
diff options
context:
space:
mode:
authorPatrick Georgi <patrick@georgi-clan.de>2014-05-17 18:38:10 +0200
committerPatrick Georgi <patrick@georgi-clan.de>2014-05-17 21:15:15 +0200
commite47477e52ced46986c352a0ae6cf798c9a7aa560 (patch)
tree2ffab8c2bf8785eb6139bd5cf5192c464db1d290 /toolchain.inc
parentfadbe5f657147f5232b2e0ad2a2a8b654cbeb219 (diff)
downloadcoreboot-e47477e52ced46986c352a0ae6cf798c9a7aa560.tar.gz
coreboot-e47477e52ced46986c352a0ae6cf798c9a7aa560.tar.bz2
coreboot-e47477e52ced46986c352a0ae6cf798c9a7aa560.zip
build: re-enable ccache support
The ccache support was mostly disabled because it didn't hook onto most compilers anymore. Caveat: ccache and scan-build don't work together since scan-build doesn't like arguments in its compiler command line (eg. "ccache gcc"). Change-Id: I7c1c6e22cb662f2b08e774ea484ac1c412fdd2db Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/5775 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Diffstat (limited to 'toolchain.inc')
-rw-r--r--toolchain.inc20
1 files changed, 19 insertions, 1 deletions
diff --git a/toolchain.inc b/toolchain.inc
index bfa604b98662..568097e008f2 100644
--- a/toolchain.inc
+++ b/toolchain.inc
@@ -19,6 +19,24 @@
ARCH_SUPPORTED := armv7 x86_32
+# ccache integration
+ifeq ($(CONFIG_CCACHE),y)
+
+CCACHE:=$(word 1,$(wildcard $(addsuffix /ccache,$(subst :, ,$(PATH)))))
+ifeq ($(CCACHE),)
+$(error ccache selected, but not found in PATH)
+endif
+
+export CCACHE_COMPILERCHECK=content
+export CCACHE_BASEDIR=$(top)
+
+$(foreach arch,$(ARCH_SUPPORTED), \
+ $(eval CC_$(arch):=$(CCACHE) $(CC_$(arch))))
+
+HOSTCC:=$(CCACHE) $(HOSTCC)
+HOSTCXX:=$(CCACHE) $(HOSTCXX)
+ROMCC=$(CCACHE) $(ROMCC_BIN)
+endif
# scan-build integration
ifneq ($(CCC_ANALYZER_OUTPUT_FORMAT),)
@@ -28,7 +46,7 @@ export CCC_ANALYZER_ANALYSIS := -analyzer-opt-analyze-headers
endif
$(foreach arch,$(ARCH_SUPPORTED), \
- $(eval CC_$(arch):=CCC_CC=$(CC_$(arch)) $(CC) ))
+ $(eval CC_$(arch):=CCC_CC="$(CC_$(arch))" $(CC) ))
HOSTCC:=CCC_CC="$(HOSTCC)" $(CC)
HOSTCXX:=CCC_CXX="$(HOSTCXX)" $(CXX)