From 6ae4b9868a8f723cae2600722eea033fafadd399 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Fri, 23 Dec 2022 01:25:34 +0900 Subject: kbuild: allow to combine multiple V= levels Commit a6de553da01c ("kbuild: Allow to combine multiple W= levels") supported W=123 to enable all the extra warning groups. I think a similar idea is applicable to the V= option. V=1 echos the whole command V=2 prints the reason for rebuilding These are orthogonal, and can be enabled at the same time. This commit supports V=12 to enable both of them. Signed-off-by: Masahiro Yamada Tested-by: Nicolas Schier Reviewed-by: Nicolas Schier --- scripts/Kbuild.include | 4 ++-- scripts/tags.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index faae3c7986b0..10cf8d2d82ef 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -132,7 +132,7 @@ clean := -f $(srctree)/scripts/Makefile.clean obj # If quiet is empty, print short log and whole command silent_log_print = exec >/dev/null; quiet_log_print = $(if $(quiet_cmd_$1), echo ' $(call escsq,$(quiet_cmd_$1)$(why))';) - log_print = echo '$(pound) $(call escsq,$(or $(quiet_cmd_$1),cmd_$1 $@))'; \ + log_print = echo '$(pound) $(call escsq,$(or $(quiet_cmd_$1),cmd_$1 $@)$(why))'; \ echo ' $(call escsq,$(cmd_$1))'; # Delete the target on interruption @@ -233,7 +233,7 @@ if_changed_rule = $(if $(if-changed-cond),$(rule_$(1)),@:) # (5) No dir/.target.cmd file (used to store command line) # (6) No dir/.target.cmd file and target not listed in $(targets) # This is a good hint that there is a bug in the kbuild file -ifeq ($(KBUILD_VERBOSE),2) +ifneq ($(findstring 2, $(KBUILD_VERBOSE)),) _why = \ $(if $(filter $@, $(PHONY)),- due to target is PHONY, \ $(if $(wildcard $@), \ diff --git a/scripts/tags.sh b/scripts/tags.sh index e137cf15aae9..2e756bee1fa9 100755 --- a/scripts/tags.sh +++ b/scripts/tags.sh @@ -8,7 +8,7 @@ # Uses the following environment variables: # SUBARCH, SRCARCH, srctree -if [ "$KBUILD_VERBOSE" = "1" ]; then +if [[ "$KBUILD_VERBOSE" =~ 1 ]]; then set -x fi -- cgit v1.2.3