summaryrefslogtreecommitdiff
path: root/include/verbose.mk
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-04-26 17:53:56 +0000
committerFelix Fietkau <nbd@openwrt.org>2012-04-26 17:53:56 +0000
commit34ffb526a27dc3f1bf16cd6cdebbfa08c40a6d7a (patch)
tree8868b74560909f5524164014dc7e890be4d6f65d /include/verbose.mk
parentd7b7b99d6e9195e0e563d14336628b533b0fcd29 (diff)
downloadmtk-20170518-34ffb526a27dc3f1bf16cd6cdebbfa08c40a6d7a.zip
mtk-20170518-34ffb526a27dc3f1bf16cd6cdebbfa08c40a6d7a.tar.gz
mtk-20170518-34ffb526a27dc3f1bf16cd6cdebbfa08c40a6d7a.tar.bz2
build: rework verbosity level selection
V=99 and V=1 are now deprecated in favor of a new verbosity class system, though the old flags are still supported. You can set the V variable on the command line (or OPENWRT_VERBOSE in the environment) to one or more of the following characters: - s: stdout+stderr (equal to the old V=99) - c: commands (for build systems that suppress commands by default, e.g. kbuild) - w: warnings/errors only (equal to the old V=1) SVN-Revision: 31484
Diffstat (limited to 'include/verbose.mk')
-rw-r--r--include/verbose.mk31
1 files changed, 17 insertions, 14 deletions
diff --git a/include/verbose.mk b/include/verbose.mk
index 9fe27ce..e17b126 100644
--- a/include/verbose.mk
+++ b/include/verbose.mk
@@ -5,16 +5,23 @@
# See /LICENSE for more information.
#
-ifeq ($(NO_TRACE_MAKE),)
-NO_TRACE_MAKE := $(MAKE) V=99
-export NO_TRACE_MAKE
+ifndef OPENWRT_VERBOSE
+ OPENWRT_VERBOSE:=
+endif
+ifeq ("$(origin V)", "command line")
+ OPENWRT_VERBOSE:=$(V)
endif
-ifndef KBUILD_VERBOSE
- KBUILD_VERBOSE:=0
+ifeq ($(OPENWRT_VERBOSE),1)
+ OPENWRT_VERBOSE:=w
endif
-ifeq ("$(origin V)", "command line")
- KBUILD_VERBOSE:=$(V)
+ifeq ($(OPENWRT_VERBOSE),99)
+ OPENWRT_VERBOSE:=s
+endif
+
+ifeq ($(NO_TRACE_MAKE),)
+NO_TRACE_MAKE := $(MAKE) V=$(subst w,s,$(OPENWRT_VERBOSE))
+export NO_TRACE_MAKE
endif
ifeq ($(IS_TTY),1)
@@ -24,7 +31,7 @@ ifeq ($(IS_TTY),1)
endif
endif
-ifneq ($(KBUILD_VERBOSE),99)
+ifeq ($(findstring s,$(OPENWRT_VERBOSE)),)
define MESSAGE
printf "$(_Y)%s$(_N)\n" "$(1)" >&8
endef
@@ -40,13 +47,9 @@ ifneq ($(KBUILD_VERBOSE),99)
))
SUBMAKE=$(MAKE)
else
- ifeq ($(KBUILD_VERBOSE),0)
- SILENT:=>/dev/null 2>&1
- else
- SILENT:=
- endif
+ SILENT:=>/dev/null $(if $(findstring w,$(OPENWRT_VERBOSE)),,2>&1)
export QUIET:=1
- SUBMAKE=cmd() { $(SILENT) $(MAKE) -s $$* < /dev/null || { echo "make $$*: build failed. Please re-run make with V=99 to see what's going on"; false; } } 8>&1 9>&2; cmd
+ SUBMAKE=cmd() { $(SILENT) $(MAKE) -s $$* < /dev/null || { echo "make $$*: build failed. Please re-run make with V=s to see what's going on"; false; } } 8>&1 9>&2; cmd
endif
.SILENT: $(MAKECMDGOALS)