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 /include/host-build.mk | |
parent | 23de93a5216bf1c24c4e4c71f6cad4455c3cfa2c (diff) | |
download | upstream-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 'include/host-build.mk')
-rw-r--r-- | include/host-build.mk | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/host-build.mk b/include/host-build.mk index 9fc14241c6..7d84ab0f5f 100644 --- a/include/host-build.mk +++ b/include/host-build.mk @@ -132,7 +132,9 @@ define Host/Exports/Default $(1) : export STAGING_PREFIX=$$(HOST_BUILD_PREFIX) $(1) : export PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig:$$(HOST_BUILD_PREFIX)/lib/pkgconfig $(1) : export PKG_CONFIG_LIBDIR=$$(HOST_BUILD_PREFIX)/lib/pkgconfig - $(if $(CONFIG_CCACHE),$(1) : export CCACHE_DIR:=$(STAGING_DIR_HOST)/ccache) + $(if $(CONFIG_CCACHE),$(1) : export CCACHE_BASEDIR:=$(TOPDIR)) + $(if $(CONFIG_CCACHE),$(1) : export CCACHE_DIR:=$(if $(call qstrip,$(CONFIG_CCACHE_DIR)),$(call qstrip,$(CONFIG_CCACHE_DIR)),$(TOPDIR)/.ccache)) + $(if $(CONFIG_CCACHE),$(1) : export CCACHE_COMPILERCHECK:=%compiler% -dumpmachine; %compiler% -dumpversion) $(if $(HOST_CONFIG_SITE),$(1) : export CONFIG_SITE:=$(HOST_CONFIG_SITE)) $(if $(IS_PACKAGE_BUILD),$(1) : export PATH=$$(TARGET_PATH_PKG)) endef |