aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorPatrick Georgi <patrick.georgi@coresystems.de>2010-03-25 21:45:25 +0000
committerPatrick Georgi <patrick.georgi@coresystems.de>2010-03-25 21:45:25 +0000
commit516a2a7bfaee5d4aa4d1e7e5ff52d3038513c82f (patch)
tree5dc3dcc6d27c286af863850e2c88b796583ffe08 /Makefile
parent0ab9d12e290ab79786d34fdf12c99922f5255aff (diff)
Add support to build with ccache in the build system
Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5297 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 12 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index f2fa6fc313..2e594e3ffd 100644
--- a/Makefile
+++ b/Makefile
@@ -61,6 +61,7 @@ endif
endif
CPP:= $(CC) -x assembler-with-cpp -DASSEMBLY -E
+ROMCC:= $(obj)/romcc
HOSTCC = gcc
HOSTCXX = g++
HOSTCFLAGS := -I$(srck) -I$(objk) -g
@@ -85,6 +86,17 @@ HOSTCC:=clang
endif
endif
+ifeq ($(CONFIG_CCACHE),y)
+CCACHE:=CCACHE_COMPILERCHECK=content $(wildcard $(addsuffix /ccache,$(subst :, ,$(PATH))))
+ifeq ($(CCACHE),)
+$(error ccache selected, but not found in PATH)
+endif
+CC := $(CCACHE) $(CC)
+HOSTCC := $(CCACHE) $(HOSTCC)
+HOSTCXX := $(CCACHE) $(HOSTCXX)
+ROMCC := $(CCACHE) $(ROMCC)
+endif
+
strip_quotes = $(subst ",,$(subst \",,$(1)))
ARCHDIR-$(CONFIG_ARCH_X86) := i386