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>
This commit is contained in:
Roman Yeryomin
2020-06-12 21:43:46 +03:00
committed by Petr Štetiar
parent 23de93a521
commit 2ca084ccaa
9 changed files with 29 additions and 10 deletions

1
.gitignore vendored
View File

@@ -28,3 +28,4 @@ TAGS*~
git-src
.project
.cproject
.ccache