Makefile: Match the full path to ccache for filtering

One can use ccache by keeping ccache in PATH or by providing the full
path to ccache as well. Providing the full path to ccache fails as the
current regex tries to look for ccache being the initial token during
filtering.

Do a greedy search to remove anything before ccache for regex matching.

Fixes: 04b1d84221 ("Makefile: fix empty MK_ARCH when using ccache")
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
This commit is contained in:
Manorit Chawdhry
2024-12-10 14:46:45 +05:30
committed by Tom Rini
parent 0b7f4c7cf3
commit c06705a9a1

View File

@@ -21,7 +21,7 @@ include include/host_arch.h
ifeq ("", "$(CROSS_COMPILE)") ifeq ("", "$(CROSS_COMPILE)")
MK_ARCH="${shell uname -m}" MK_ARCH="${shell uname -m}"
else else
MK_ARCH="${shell echo $(CROSS_COMPILE) | sed -n 's/^\(ccache\)\{0,1\}[[:space:]]*\([^\/]*\/\)*\([^-]*\)-[^[:space:]]*/\3/p'}" MK_ARCH="${shell echo $(CROSS_COMPILE) | sed -n 's/^\(.*ccache\)\{0,1\}[[:space:]]*\([^\/]*\/\)*\([^-]*\)-[^[:space:]]*/\3/p'}"
endif endif
unexport HOST_ARCH unexport HOST_ARCH
ifeq ("x86_64", $(MK_ARCH)) ifeq ("x86_64", $(MK_ARCH))