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.
Unified · Split
| @@ -9,7 +9,7 @@ config DEFCONFIG_LIST · 8 unmodified lines | ||
| 9 | 9 | default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)" |
| 10 | 10 | |
| 11 | 11 | 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) | |
| 13 | 13 | |
| 14 | 14 | config GCC_VERSION |
| 15 | 15 | int |
| @@ -21,7 +21,7 @@ config LD_VERSION · 5 unmodified lines | ||
| 21 | 21 | default $(shell,$(LD) --version | $(srctree)/scripts/ld-version.sh) |
| 22 | 22 | |
| 23 | 23 | 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) | |
| 25 | 25 | |
| 26 | 26 | config CLANG_VERSION |
| 27 | 27 | int |