Improve how build.sh -N and MAKEVERBOSE interoperate;

rather than adding '-s' to make's command line in the makewrapper,
use the .SILENT target based on MAKEVERBOSE's value.

This means that you can do:
	./build.sh -N 1 makewrapper

	$TOOLDIR/bin/nbmake-$MACHINE
	#  runs at MAKEVERBOSE==1, with command lines suppressed

	$TOOLDIR/bin/nbmake-$MACHINE MAKEVERBOSE=2
	#  runs at MAKEVERBOSE==2 for this invocation, with command lines shown
This commit is contained in:
lukem 2003-10-26 02:17:46 +00:00
parent 371e58334b
commit 5daa33014e
4 changed files with 18 additions and 33 deletions

View File

@ -578,14 +578,8 @@ BUILDING
sbmips-el sbmips mipsel
-N noiselevel
Set the ``noisyness'' level of the build Supported values of
noiselevel are:
0 Quiet build.
1 Operations are described, command lines are suppressed.
2 Noisy build. This is the default.
Set the ``noisyness'' level of the build, by setting
MAKEVERBOSE to noiselevel.
-n Show the commands that would be executed by build.sh, but do
not make any changes. This is similar in concept to ``make

View File

@ -1,5 +1,5 @@
#! /usr/bin/env sh
# $NetBSD: build.sh,v 1.120 2003/10/26 02:00:37 lukem Exp $
# $NetBSD: build.sh,v 1.121 2003/10/26 02:17:46 lukem Exp $
#
# Copyright (c) 2001-2003 The NetBSD Foundation, Inc.
# All rights reserved.
@ -493,16 +493,13 @@ parseoptions()
-N)
eval ${optargcmd}
case "${OPTARG}" in
0|1)
MAKEFLAGS="${MAKEFLAGS} -s"
;;
2)
0|1|2)
setmakeenv MAKEVERBOSE "${OPTARG}"
;;
*)
usage "'${OPTARG}' is not a valid value for -N"
;;
esac
setmakeenv MAKEVERBOSE "${OPTARG}"
;;
-n)
@ -834,7 +831,7 @@ createmakewrapper()
eval cat <<EOF ${makewrapout}
#! /bin/sh
# Set proper variables to allow easy "make" building of a NetBSD subtree.
# Generated from: \$NetBSD: build.sh,v 1.120 2003/10/26 02:00:37 lukem Exp $
# Generated from: \$NetBSD: build.sh,v 1.121 2003/10/26 02:17:46 lukem Exp $
#
EOF

View File

@ -1,4 +1,4 @@
.\" $NetBSD: BUILDING.mdoc,v 1.30 2003/10/25 03:46:09 lukem Exp $
.\" $NetBSD: BUILDING.mdoc,v 1.31 2003/10/26 02:17:46 lukem Exp $
.\"
.\" Copyright (c) 2001-2003 The NetBSD Foundation, Inc.
.\" All rights reserved.
@ -1115,19 +1115,10 @@ values will result:
.It Fl N Ar noiselevel
Set the
.Dq noisyness
level of the build
Supported values of
.Ar noiselevel
are:
.Bl -tag -width xxx
.It 0
Quiet build.
.It 1
Operations are described, command lines are suppressed.
.It 2
Noisy build.
This is the default.
.El
level of the build, by setting
.Sy MAKEVERBOSE
to
.Ar noiselevel .
.
.It Fl n
Show the commands that would be executed by

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.own.mk,v 1.379 2003/10/26 01:29:34 simonb Exp $
# $NetBSD: bsd.own.mk,v 1.380 2003/10/26 02:17:46 lukem Exp $
.if !defined(_BSD_OWN_MK_)
_BSD_OWN_MK_=1
@ -718,9 +718,9 @@ X11USRLIBDIR?= ${X11ROOTDIR}/lib
#
# MAKEVERBOSE support. Levels are:
# 0 No messages (use with make -s)
# 1 Enable info messages, suppress command output (use with make -s)
# 2 Enable all messages including info messages.
# 0 No messages
# 1 Enable info messages, suppress command output
# 2 Enable info messages and command output
#
MAKEVERBOSE?= 2
@ -728,14 +728,17 @@ MAKEVERBOSE?= 2
_MKMSG?= @\#
_MKSHMSG?= : echo
_MKSHECHO?= : echo
.SILENT:
.elif ${MAKEVERBOSE} == 1
_MKMSG?= @echo ' '
_MKSHMSG?= echo ' '
_MKSHECHO?= : echo
.SILENT:
.else # MAKEVERBOSE == 2 ?
_MKMSG?= @echo '\# '
_MKSHMSG?= echo '\# '
_MKSHECHO?= echo
.SILENT: __makeverbose_dummy_target__
.endif
_MKMSG_BUILD?= ${_MKMSG} " build "