]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
Makefile: fix empty MK_ARCH when using ccache
authorQuentin Schulz <quentin.schulz@cherry.de>
Mon, 11 Nov 2024 13:20:49 +0000 (14:20 +0100)
committerTom Rini <trini@konsulko.com>
Thu, 14 Nov 2024 16:51:28 +0000 (10:51 -0600)
One can use ccache by prefixing the typical CROSS_COMPILE value with
"ccache " (e.g. "ccache aarch64-gnu-linux-" for Aarch64). This however
makes the MK_ARCH empty because sed won't find a match anymore since it
expects the CROSS_COMPILE value to start with the actual toolchain (with
an unlimited number of white spaces before).

This is failing builds since commit 7506c1566998 ("sandbox: Report host
default-filename in native mode").

Add "ccache" prefix to ignore but participate in the matching regex used
by sed to identify the target architecture.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Makefile

index da742ceae76e484f11d31edca5afd0e2da55a320..2eaae427961087a6394e1ab1bd2b867467ee1b0b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -21,7 +21,7 @@ include include/host_arch.h
 ifeq ("", "$(CROSS_COMPILE)")
   MK_ARCH="${shell uname -m}"
 else
-  MK_ARCH="${shell echo $(CROSS_COMPILE) | sed -n 's/^[[:space:]]*\([^\/]*\/\)*\([^-]*\)-[^[:space:]]*/\2/p'}"
+  MK_ARCH="${shell echo $(CROSS_COMPILE) | sed -n 's/^\(ccache\)\?[[:space:]]*\([^\/]*\/\)*\([^-]*\)-[^[:space:]]*/\3/p'}"
 endif
 unexport HOST_ARCH
 ifeq ("x86_64", $(MK_ARCH))