Commit 6ae4b986 authored by Masahiro Yamada's avatar Masahiro Yamada

kbuild: allow to combine multiple V= levels

Commit a6de553d ("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: default avatarMasahiro Yamada <masahiroy@kernel.org>
Tested-by: default avatarNicolas Schier <nicolas@fjasle.eu>
Reviewed-by: default avatarNicolas Schier <nicolas@fjasle.eu>
parent c0d3b831
...@@ -69,9 +69,8 @@ unexport GREP_OPTIONS ...@@ -69,9 +69,8 @@ unexport GREP_OPTIONS
# #
# $(Q)$(MAKE) $(build)=scripts/basic # $(Q)$(MAKE) $(build)=scripts/basic
# #
# If KBUILD_VERBOSE equals 0 then the above command will be hidden. # If KBUILD_VERBOSE contains 1, the whole command is echoed.
# If KBUILD_VERBOSE equals 1 then the above command is displayed. # If KBUILD_VERBOSE contains 2, the reason for rebuilding is printed.
# If KBUILD_VERBOSE equals 2 then give the reason why each target is rebuilt.
# #
# To put more focus on warnings, be less verbose as default # To put more focus on warnings, be less verbose as default
# Use 'make V=1' to see the full commands # Use 'make V=1' to see the full commands
...@@ -83,12 +82,12 @@ ifndef KBUILD_VERBOSE ...@@ -83,12 +82,12 @@ ifndef KBUILD_VERBOSE
KBUILD_VERBOSE = 0 KBUILD_VERBOSE = 0
endif endif
ifeq ($(KBUILD_VERBOSE),1) quiet = quiet_
Q = @
ifneq ($(findstring 1, $(KBUILD_VERBOSE)),)
quiet = quiet =
Q = Q =
else
quiet=quiet_
Q = @
endif endif
# If the user is running make -s (silent mode), suppress echoing of # If the user is running make -s (silent mode), suppress echoing of
...@@ -1775,8 +1774,9 @@ help: ...@@ -1775,8 +1774,9 @@ help:
printf " %-16s - Show all of the above\\n" help-boards; \ printf " %-16s - Show all of the above\\n" help-boards; \
echo '') echo '')
@echo ' make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build' @echo ' make V=n [targets] 0: quiet build (default), 1: verbose build'
@echo ' make V=2 [targets] 2 => give reason for rebuild of target' @echo ' 2: give reason for rebuild of target'
@echo ' V=1 and V=2 can be combined with V=12'
@echo ' make O=dir [targets] Locate all output files in "dir", including .config' @echo ' make O=dir [targets] Locate all output files in "dir", including .config'
@echo ' make C=1 [targets] Check re-compiled c source with $$CHECK' @echo ' make C=1 [targets] Check re-compiled c source with $$CHECK'
@echo ' (sparse by default)' @echo ' (sparse by default)'
......
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
PHONY += posttest PHONY += posttest
ifeq ($(KBUILD_VERBOSE),1) ifneq ($(findstring 1, $(KBUILD_VERBOSE)),)
posttest_verbose = -v posttest_verbose = -v
else else
posttest_verbose = posttest_verbose =
......
...@@ -132,7 +132,7 @@ clean := -f $(srctree)/scripts/Makefile.clean obj ...@@ -132,7 +132,7 @@ clean := -f $(srctree)/scripts/Makefile.clean obj
# If quiet is empty, print short log and whole command # If quiet is empty, print short log and whole command
silent_log_print = exec >/dev/null; silent_log_print = exec >/dev/null;
quiet_log_print = $(if $(quiet_cmd_$1), echo ' $(call escsq,$(quiet_cmd_$1)$(why))';) 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))'; echo ' $(call escsq,$(cmd_$1))';
# Delete the target on interruption # Delete the target on interruption
...@@ -233,7 +233,7 @@ if_changed_rule = $(if $(if-changed-cond),$(rule_$(1)),@:) ...@@ -233,7 +233,7 @@ if_changed_rule = $(if $(if-changed-cond),$(rule_$(1)),@:)
# (5) No dir/.target.cmd file (used to store command line) # (5) No dir/.target.cmd file (used to store command line)
# (6) No dir/.target.cmd file and target not listed in $(targets) # (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 # This is a good hint that there is a bug in the kbuild file
ifeq ($(KBUILD_VERBOSE),2) ifneq ($(findstring 2, $(KBUILD_VERBOSE)),)
_why = \ _why = \
$(if $(filter $@, $(PHONY)),- due to target is PHONY, \ $(if $(filter $@, $(PHONY)),- due to target is PHONY, \
$(if $(wildcard $@), \ $(if $(wildcard $@), \
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
# Uses the following environment variables: # Uses the following environment variables:
# SUBARCH, SRCARCH, srctree # SUBARCH, SRCARCH, srctree
if [ "$KBUILD_VERBOSE" = "1" ]; then if [[ "$KBUILD_VERBOSE" =~ 1 ]]; then
set -x set -x
fi fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment