diff options
author | Roman Yeryomin <roman@advem.lv> | 2020-06-12 21:43:46 +0300 |
---|---|---|
committer | Petr Štetiar <ynezz@true.cz> | 2020-07-11 15:19:53 +0200 |
commit | 2ca084ccaae619ac8031e902c66817d021ac6fd5 (patch) | |
tree | 821349dcff0400e92ff84659554bc66f4197c481 /Makefile | |
parent | 23de93a5216bf1c24c4e4c71f6cad4455c3cfa2c (diff) | |
download | openwrt-2ca084ccaae619ac8031e902c66817d021ac6fd5.tar.gz openwrt-2ca084ccaae619ac8031e902c66817d021ac6fd5.tar.bz2 openwrt-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 'Makefile')
-rw-r--r-- | Makefile | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -62,6 +62,11 @@ dirclean: clean rm -rf $(TMP_DIR) $(MAKE) -C $(TOPDIR)/scripts/config clean +cacheclean: +ifneq ($(CONFIG_CCACHE),) + rm -rf $(if $(call qstrip,$(CONFIG_CCACHE_DIR)),$(call qstrip,$(CONFIG_CCACHE_DIR)),$(TOPDIR)/.ccache) +endif + ifndef DUMP_TARGET_DB $(BUILD_DIR)/.prepared: Makefile @mkdir -p $$(dirname $@) @@ -119,6 +124,9 @@ world: prepare $(target/stamp-compile) $(package/stamp-compile) $(package/stamp- $(_SINGLE)$(SUBMAKE) -r package/index $(_SINGLE)$(SUBMAKE) -r json_overview_image_info $(_SINGLE)$(SUBMAKE) -r checksum +ifneq ($(CONFIG_CCACHE),) + $(STAGING_DIR_HOST)/bin/ccache -s +endif .PHONY: clean dirclean prereq prepare world package/symlinks package/symlinks-install package/symlinks-clean |