util/testing: Separate ccache option from abuild options

scanbuild and ccache don't work together, so separate ccache from the
rest of the abuild options. All of the other tests get ccache, but
scanbuild never does.

Signed-off-by: Martin Roth <gaumless@gmail.com>
Change-Id: If057ed20c687ac8b501d20c6b4af91f8c0ab84b7
Reviewed-on: https://review.coreboot.org/c/coreboot/+/77326
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
diff --git a/util/testing/Makefile.inc b/util/testing/Makefile.inc
index ff55df0..0e4cad6 100644
--- a/util/testing/Makefile.inc
+++ b/util/testing/Makefile.inc
@@ -78,9 +78,10 @@
 
 ABUILD_OPTIONS=--blobs --junit --cpus $(CPUS) --payloads $(JENKINS_PAYLOAD)
 ABUILD_OPTIONS+=$(if $(V),--verbose,)
-ABUILD_OPTIONS+=$(if $(JENKINS_NOCCACHE),,--ccache)
 ABUILD_OPTIONS+=$(JENKINS_ABUILD_OPT)
 
+CCACHE_OPTIONS=$(if $(JENKINS_NOCCACHE),,--ccache)
+
 COREBOOT_BUILD_DIR?=coreboot-builds
 
 validate_sec_tools:
@@ -119,12 +120,12 @@
 	NAME=scanbuild; SCANBUILD_ARGS='-k -plist-html -maxloop 10' util/abuild/abuild -o $(COREBOOT_BUILD_DIR)/$${NAME} $(ABUILD_OPTIONS) -scan-build --target EMULATION_QEMU_X86_Q35 --exitcode --name $${NAME}
 endif
 ifneq ($(JENKINS_SKIP_GCC_TESTS),y)
-	NAME=gcc-chromeos; util/abuild/abuild -o $(COREBOOT_BUILD_DIR)/$${NAME} $(ABUILD_OPTIONS) -x --name $${NAME} --clean
-	NAME=gcc; util/abuild/abuild -o $(COREBOOT_BUILD_DIR)/$${NAME} $(ABUILD_OPTIONS) --name $${NAME} --clean-somewhat
+	NAME=gcc-chromeos; util/abuild/abuild -o $(COREBOOT_BUILD_DIR)/$${NAME} $(ABUILD_OPTIONS) $(CCACHE_OPTIONS) -x --name $${NAME} --clean
+	NAME=gcc; util/abuild/abuild -o $(COREBOOT_BUILD_DIR)/$${NAME} $(ABUILD_OPTIONS) $(CCACHE_OPTIONS) --name $${NAME} --clean-somewhat
 endif
 ifneq ($(JENKINS_SKIP_CLANG_TESTS),y)
-	NAME=clang-chromeos; util/abuild/abuild -o $(COREBOOT_BUILD_DIR)/$${NAME} $(ABUILD_OPTIONS) -L -x --name $${NAME} --clean
-	NAME=clang; util/abuild/abuild -o $(COREBOOT_BUILD_DIR)/$${NAME} $(ABUILD_OPTIONS) -L --name $${NAME} --clean
+	NAME=clang-chromeos; util/abuild/abuild -o $(COREBOOT_BUILD_DIR)/$${NAME} $(ABUILD_OPTIONS) $(CCACHE_OPTIONS) -L -x --name $${NAME} --clean
+	NAME=clang; util/abuild/abuild -o $(COREBOOT_BUILD_DIR)/$${NAME} $(ABUILD_OPTIONS) $(CCACHE_OPTIONS) -L --name $${NAME} --clean
 endif
 
 test-payloads: