summaryrefslogtreecommitdiff
path: root/package/Makefile.in
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2010-12-07 21:09:56 +0100
committerPeter Korsgaard <jacmet@sunsite.dk>2010-12-08 17:51:49 +0100
commit17b66affdf439ed7c35d2825a1e2bf7967191e14 (patch)
tree1ca4fdfe4efb06a8a081236c492531d9697e22bf /package/Makefile.in
parent3bbf1c2ea6140d8b288b0af5b1a9c3a1aa92edad (diff)
ccache: rework ccache management
* ccache is now a normal package (both for the host and the target). * ccache option is now part of the "Build options" menu. It will automatically build ccache for the host before building anything, and will use it to cache builds for both host compilations and target compilations. * bump ccache to 3.1.3 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package/Makefile.in')
-rw-r--r--package/Makefile.in10
1 files changed, 9 insertions, 1 deletions
diff --git a/package/Makefile.in b/package/Makefile.in
index 2ca8c3144..d448a7edf 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -142,6 +142,14 @@ TARGET_RANLIB = $(TARGET_CROSS)ranlib
TARGET_OBJCOPY = $(TARGET_CROSS)objcopy
TARGET_OBJDUMP = $(TARGET_CROSS)objdump
+TARGET_CC_NOCCACHE := $(TARGET_CC)
+TARGET_CXX_NOCCACHE := $(TARGET_CXX)
+
+ifeq ($(BR2_CCACHE),y)
+TARGET_CC := $(CCACHE) $(TARGET_CC)
+TARGET_CXX := $(CCACHE) $(TARGET_CXX)
+endif
+
ifeq ($(BR2_STRIP_strip),y)
STRIP_DISCARD_ALL:=--discard-all
STRIP_STRIP_UNNEEDED:=--strip-unneeded
@@ -175,7 +183,7 @@ HOST_LDFLAGS += -L$(HOST_DIR)/lib -L$(HOST_DIR)/usr/lib -Wl,-rpath,$(HOST_DIR)/
HOST_PATH=$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(PATH)
# hostcc version as an integer - E.G. 4.3.2 => 432
-HOSTCC_VERSION:=$(shell $(HOSTCC) --version | \
+HOSTCC_VERSION:=$(shell $(HOSTCC_NOCCACHE) --version | \
sed -n 's/^.* \([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)[ ]*.*$$/\1\2\3/p')
TARGET_CONFIGURE_OPTS=PATH=$(TARGET_PATH) \