Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Improve how build.sh -N and MAKEVERBOSE interoperate;



details:   https://anonhg.NetBSD.org/src/rev/1a0acdf7bcd9
branches:  trunk
changeset: 554212:1a0acdf7bcd9
user:      lukem <lukem%NetBSD.org@localhost>
date:      Sun Oct 26 02:17:46 2003 +0000

description:
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

diffstat:

 BUILDING            |  10 ++--------
 build.sh            |  11 ++++-------
 doc/BUILDING.mdoc   |  19 +++++--------------
 share/mk/bsd.own.mk |  11 +++++++----
 4 files changed, 18 insertions(+), 33 deletions(-)

diffs (131 lines):

diff -r e6c3398f6950 -r 1a0acdf7bcd9 BUILDING
--- a/BUILDING  Sun Oct 26 02:00:37 2003 +0000
+++ b/BUILDING  Sun Oct 26 02:17:46 2003 +0000
@@ -578,14 +578,8 @@
                      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
diff -r e6c3398f6950 -r 1a0acdf7bcd9 build.sh
--- a/build.sh  Sun Oct 26 02:00:37 2003 +0000
+++ b/build.sh  Sun Oct 26 02:17:46 2003 +0000
@@ -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 @@
                -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 @@
        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
diff -r e6c3398f6950 -r 1a0acdf7bcd9 doc/BUILDING.mdoc
--- a/doc/BUILDING.mdoc Sun Oct 26 02:00:37 2003 +0000
+++ b/doc/BUILDING.mdoc Sun Oct 26 02:17:46 2003 +0000
@@ -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 @@
 .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
diff -r e6c3398f6950 -r 1a0acdf7bcd9 share/mk/bsd.own.mk
--- a/share/mk/bsd.own.mk       Sun Oct 26 02:00:37 2003 +0000
+++ b/share/mk/bsd.own.mk       Sun Oct 26 02:17:46 2003 +0000
@@ -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 @@
 
 #
 # 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 @@
 _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 "



Home | Main Index | Thread Index | Old Index