1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-27 18:23:09 +02:00

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)

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31484 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nbd 2012-04-26 17:53:56 +00:00
parent b2caa2e0b5
commit 87e474d1bb
4 changed files with 22 additions and 22 deletions

View File

@ -9,7 +9,8 @@ KERNEL_MAKEOPTS := -C $(LINUX_DIR) \
CROSS_COMPILE="$(KERNEL_CROSS)" \ CROSS_COMPILE="$(KERNEL_CROSS)" \
ARCH="$(LINUX_KARCH)" \ ARCH="$(LINUX_KARCH)" \
KBUILD_HAVE_NLS=no \ KBUILD_HAVE_NLS=no \
CONFIG_SHELL="$(BASH)" CONFIG_SHELL="$(BASH)" \
$(if $(findstring c,$(OPENWRT_VERBOSE)),V=1)
ifdef CONFIG_STRIP_KERNEL_EXPORTS ifdef CONFIG_STRIP_KERNEL_EXPORTS
KERNEL_MAKEOPTS += \ KERNEL_MAKEOPTS += \
@ -22,10 +23,6 @@ ifneq (,$(KERNEL_CC))
KERNEL_MAKEOPTS += CC="$(KERNEL_CC)" KERNEL_MAKEOPTS += CC="$(KERNEL_CC)"
endif endif
ifeq ($(KBUILD_VERBOSE),99)
KERNEL_MAKEOPTS += V=1
endif
export HOST_EXTRACFLAGS=-I$(STAGING_DIR_HOST)/include export HOST_EXTRACFLAGS=-I$(STAGING_DIR_HOST)/include
# defined in quilt.mk # defined in quilt.mk

View File

@ -5,16 +5,23 @@
# See /LICENSE for more information. # See /LICENSE for more information.
# #
ifeq ($(NO_TRACE_MAKE),) ifndef OPENWRT_VERBOSE
NO_TRACE_MAKE := $(MAKE) V=99 OPENWRT_VERBOSE:=
export NO_TRACE_MAKE
endif
ifndef KBUILD_VERBOSE
KBUILD_VERBOSE:=0
endif endif
ifeq ("$(origin V)", "command line") ifeq ("$(origin V)", "command line")
KBUILD_VERBOSE:=$(V) OPENWRT_VERBOSE:=$(V)
endif
ifeq ($(OPENWRT_VERBOSE),1)
OPENWRT_VERBOSE:=w
endif
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 endif
ifeq ($(IS_TTY),1) ifeq ($(IS_TTY),1)
@ -24,7 +31,7 @@ ifeq ($(IS_TTY),1)
endif endif
endif endif
ifneq ($(KBUILD_VERBOSE),99) ifeq ($(findstring s,$(OPENWRT_VERBOSE)),)
define MESSAGE define MESSAGE
printf "$(_Y)%s$(_N)\n" "$(1)" >&8 printf "$(_Y)%s$(_N)\n" "$(1)" >&8
endef endef
@ -40,13 +47,9 @@ ifneq ($(KBUILD_VERBOSE),99)
)) ))
SUBMAKE=$(MAKE) SUBMAKE=$(MAKE)
else else
ifeq ($(KBUILD_VERBOSE),0) SILENT:=>/dev/null $(if $(findstring w,$(OPENWRT_VERBOSE)),,2>&1)
SILENT:=>/dev/null 2>&1
else
SILENT:=
endif
export QUIET:=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 endif
.SILENT: $(MAKECMDGOALS) .SILENT: $(MAKECMDGOALS)

View File

@ -540,7 +540,7 @@ sub update {
my $perform_update=1; my $perform_update=1;
$ENV{SCAN_COOKIE} = $$; $ENV{SCAN_COOKIE} = $$;
$ENV{KBUILD_VERBOSE} = 99; $ENV{OPENWRT_VERBOSE} = 's';
getopts('ahi', \%opts); getopts('ahi', \%opts);

View File

@ -10,7 +10,7 @@ TOPDIR:=${CURDIR}
LC_ALL:=C LC_ALL:=C
LANG:=C LANG:=C
export TOPDIR LC_ALL LANG export TOPDIR LC_ALL LANG
export KBUILD_VERBOSE=99 export OPENWRT_VERBOSE=s
all: help all: help
include $(TOPDIR)/include/host.mk include $(TOPDIR)/include/host.mk