aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorRoman Yeryomin <roman@advem.lv>2020-06-12 21:43:46 +0300
committerPetr Štetiar <ynezz@true.cz>2020-07-11 15:19:53 +0200
commit2ca084ccaae619ac8031e902c66817d021ac6fd5 (patch)
tree821349dcff0400e92ff84659554bc66f4197c481 /target
parent23de93a5216bf1c24c4e4c71f6cad4455c3cfa2c (diff)
downloadupstream-2ca084ccaae619ac8031e902c66817d021ac6fd5.tar.gz
upstream-2ca084ccaae619ac8031e902c66817d021ac6fd5.tar.bz2
upstream-2ca084ccaae619ac8031e902c66817d021ac6fd5.zip
build: improve ccache support
Set CCACHE_DIR to $(TOPDIR)/.ccache and CCACHE_BASEDIR to $(TOPDIR). This allows to do clean and dirclean. Cache hit rate for test build after dirclean is ~65%. If CCACHE is enabled stats are printed out at the end of building process. CCACHE_DIR config variable allows to override default, which could be useful when sharing cache with many builds. cacheclean make target allows to clean the cache. Changes from v1: - remove ccache directory using CCACHE_DIR variable - remove ccache leftovers from sdk and toolchain make files - introduce CONFIG_CCACHE_DIR variable - introduce cacheclean make target Signed-off-by: Roman Yeryomin <roman@advem.lv>
Diffstat (limited to 'target')
-rw-r--r--target/sdk/Makefile8
-rw-r--r--target/toolchain/Makefile2
2 files changed, 3 insertions, 7 deletions
diff --git a/target/sdk/Makefile b/target/sdk/Makefile
index 6d81834720..d3552b47eb 100644
--- a/target/sdk/Makefile
+++ b/target/sdk/Makefile
@@ -20,7 +20,7 @@ STAGING_SUBDIR_HOST := staging_dir/host
STAGING_SUBDIR_TARGET := staging_dir/$(TARGET_DIR_NAME)
STAGING_SUBDIR_TOOLCHAIN := staging_dir/toolchain-$(ARCH)$(ARCH_SUFFIX)_gcc-$(GCCV)_$(LIBC)$(if $(CONFIG_arm),_eabi)
-EXCLUDE_DIRS:=*/ccache/* \
+EXCLUDE_DIRS:= \
*/stamp \
*/stampfiles \
*/man \
@@ -135,11 +135,7 @@ $(BIN_DIR)/$(SDK_NAME).tar.xz: clean
$(TOPDIR)/package/kernel/linux \
$(SDK_BUILD_DIR)/package/
- -rm -rf \
- $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_HOST)/ccache \
- $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_TARGET)/ccache \
- $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_TOOLCHAIN)/ccache \
- $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_HOST)/.prereq-build
+ -rm -rf $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_HOST)/.prereq-build
-rm -f $(SDK_BUILD_DIR)/feeds.conf.default
$(if $(BASE_FEED),echo "$(BASE_FEED)" > $(SDK_BUILD_DIR)/feeds.conf.default)
diff --git a/target/toolchain/Makefile b/target/toolchain/Makefile
index ef2dc68a97..5002ff7835 100644
--- a/target/toolchain/Makefile
+++ b/target/toolchain/Makefile
@@ -15,7 +15,7 @@ override MAKEFLAGS=
TOOLCHAIN_NAME:=$(VERSION_DIST_SANITIZED)-toolchain-$(if $(CONFIG_VERSION_FILENAMES),$(VERSION_NUMBER)-)$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))_gcc-$(GCCV)$(DIR_SUFFIX).$(HOST_OS)-$(HOST_ARCH)
TOOLCHAIN_BUILD_DIR:=$(BUILD_DIR)/$(TOOLCHAIN_NAME)
-EXCLUDE_DIRS:=*/ccache \
+EXCLUDE_DIRS:= \
*/initial \
*/stamp \
*/stampfiles \