diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2021-03-14 15:15:50 +0900 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2021-03-17 00:38:59 +0900 |
commit | 884a7fa1b090ccab785f9fa2a9168238d473d801 (patch) | |
tree | 6a1feaeeddf691f200eaaf8058dfc94087156b1d /Makefile | |
parent | 5946d42d6d426a560eaa6f6e5f05ad87c23535d4 (diff) | |
download | linux-next-884a7fa1b090ccab785f9fa2a9168238d473d801.tar.gz |
kbuild: replace sed with $(subst ) or $(patsubst )
For simple text replacement, it is better to use a built-in function
instead of sed if possible. You can save one process forking.
I do not mean to replace all sed invocations because GNU Make itself
does not support regular expression (unless you use guile).
I just replaced simple ones.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -574,7 +574,7 @@ endif # Some architectures define CROSS_COMPILE in arch/$(SRCARCH)/Makefile. # CC_VERSION_TEXT is referenced from Kconfig (so it needs export), # and from include/config/auto.conf.cmd to detect the compiler upgrade. -CC_VERSION_TEXT = $(shell $(CC) --version 2>/dev/null | head -n 1 | sed 's/\#//g') +CC_VERSION_TEXT = $(subst $(pound),,$(shell $(CC) --version 2>/dev/null | head -n 1)) ifneq ($(findstring clang,$(CC_VERSION_TEXT)),) ifneq ($(CROSS_COMPILE),) |