History

kbuild: use $(CC_VERSION_TEXT) to evaluate CC_IS_GCC and CC_IS_CLANG

The result of '$(CC) --version | head -n 1' has already been computed by the top Makefile, and stored in the environment variable, CC_VERSION_TEXT. 'echo' is cheaper than the two commands $(CC) and 'head' although this optimization is not noticeable level.

Masahiro Yamada committed 6 years ago

Commit e33ae3e1 parent 081b4b51 file · +2 −2Browse files

Unified · Split

init/Kconfig+2−2
@@ -9,7 +9,7 @@ config DEFCONFIG_LIST · 8 unmodified lines
99 default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)"
1010
1111 config CC_IS_GCC
12− def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc)
12+ def_bool $(success,echo "$(CC_VERSION_TEXT)" | grep -q gcc)
1313
1414 config GCC_VERSION
1515 int
@@ -21,7 +21,7 @@ config LD_VERSION · 5 unmodified lines
2121 default $(shell,$(LD) --version | $(srctree)/scripts/ld-version.sh)
2222
2323 config CC_IS_CLANG
24− def_bool $(success,$(CC) --version | head -n 1 | grep -q clang)
24+ def_bool $(success,echo "$(CC_VERSION_TEXT)" | grep -q clang)
2525
2626 config CLANG_VERSION
2727 int