build: allow romcc to be wrapped

Allow ccache and scan-build to wrap romcc.
This works a bit different from the other compilers
because we only define it later.

Change-Id: I3adce91d3dde9dd50aa6a2baad5b457744f35575
Signed-off-by: Patrick Georgi <>
Tested-by: build bot (Jenkins)
Reviewed-by: Kyösti Mälkki <>
diff --git a/ b/
index d098cff..529250d 100644
--- a/
+++ b/
@@ -280,8 +280,11 @@
-ROMCC:= $(objutil)/romcc/romcc
-$(ROMCC): $(top)/util/romcc/romcc.c
+# this allows ccache to prepend itself
+# (ccache handling happens first)
+ROMCC_BIN= $(objutil)/romcc/romcc
+$(ROMCC_BIN): $(top)/util/romcc/romcc.c
 	@printf "    HOSTCC     $(subst $(obj)/,,$(@)) (this may take a while)\n"
 	@# Note: Adding -O2 here might cause problems. For details see: