ccache: allow for BR2_CCACHE_DIR environment override
authorGustavo Zacarias <gustavo.zacarias@free-electrons.com>
Thu, 15 Oct 2015 13:24:39 +0000 (10:24 -0300)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sat, 17 Oct 2015 14:32:41 +0000 (16:32 +0200)
Allow the BR2_CCACHE_DIR .config option to be overriden by the
BR2_CCACHE_DIR env variable.
This is useful for big projects where in some cases the developers home
directory might be a NFS mount (slow) and real production builds aren't.

Update documentation accordingly as well.

Signed-off-by: Gustavo Zacarias <gustavo.zacarias@free-electrons.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Makefile
docs/manual/common-usage.txt

index c871393b79d93e0181e629ecdcfc83f6c75c7fd4..dd8959f01940ebfe03055236a69cdb82a0134b65 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -183,7 +183,9 @@ endif
 ifneq ($(BR2_DL_DIR),)
 DL_DIR := $(BR2_DL_DIR)
 endif
-
+ifneq ($(BR2_CCACHE_DIR),)
+BR_CACHE_DIR := $(BR2_CCACHE_DIR)
+endif
 
 # Need that early, before we scan packages
 # Avoids doing the $(or...) everytime
@@ -371,7 +373,7 @@ TARGET_DIR_WARNING_FILE = $(TARGET_DIR)/THIS_IS_NOT_YOUR_ROOT_FILESYSTEM
 
 ifeq ($(BR2_CCACHE),y)
 CCACHE := $(HOST_DIR)/usr/bin/ccache
-BR_CACHE_DIR = $(call qstrip,$(BR2_CCACHE_DIR))
+BR_CACHE_DIR ?= $(call qstrip,$(BR2_CCACHE_DIR))
 export BR_CACHE_DIR
 HOSTCC := $(CCACHE) $(HOSTCC)
 HOSTCXX := $(CCACHE) $(HOSTCXX)
index 3ae05c7d9d5f9433b94fb4d7533e26c0d051582d..bca99f45b965c747bdc4dbb80c213614d824cf66 100644 (file)
@@ -84,6 +84,9 @@ to +make+ or set in the environment:
   configuration interface, so through the Buildroot +.config+ file; this
   is the recommended way of setting it.
   +
+* +BR2_CCACHE_DIR+ to override the directory where
+  Buildroot stores the cached files when using ccache.
+  +
 * +BR2_DL_DIR+ to override the directory in which
   Buildroot stores/retrieves downloaded files
   +