Append per-board ccache statistics in log

Starting with ccache 4.4 it is possible to collect statistics about
cache miss/hit rates in a separate file.

Add the info of the build at end of created make.log file or on stdout.

Change-Id: I1bab712712f4d6379ec6733fdc55b234e3845da7
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/75087
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/Makefile.inc b/Makefile.inc
index abf47d4..b35ec86 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -66,8 +66,11 @@
 # targets after the build completes by creating a Makefile.inc in the
 # site-local directory with a target named 'build_complete::'
 build_complete:: coreboot
-	printf "\nBuilt %s (%s)\n" $(MAINBOARDDIR) \
-		$(CONFIG_MAINBOARD_PART_NUMBER)
+	printf "\nBuilt %s (%s)\n" $(MAINBOARDDIR) $(CONFIG_MAINBOARD_PART_NUMBER)
+	if [ -f "$(CCACHE_STATSLOG)" ]; then \
+		printf "\nccache statistics\n"; \
+		$(CCACHE) --show-log-stats -v; \
+	fi
 
 # This target can be used to run rules after all files were added to CBFS,
 # for example to process FMAP regions or the entire image.