Subject: bin/37202: Add "-dl" option to Make. The "loud" option ignores @'s, thus printing every action
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: None <obrien@nuxi.org>
List: netbsd-bugs
Date: 10/25/2007 08:05:00
>Number:         37202
>Category:       bin
>Synopsis:       Add "-dl" option to Make.  The "loud" option ignores @'s, thus printing every action
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 25 08:05:00 +0000 2007
>Originator:     David O'Brien
>Release:        All
>Organization:
>Environment:
standard
>Description:
FreeBSD's version of bmake has a very useful option - the "l" -d[ebug] option.  When using this command every command line's prefixed with "@" are displayed.  "-dl" is the opposite of "-s".
>How-To-Repeat:

>Fix:
Index: compat.c
===================================================================
RCS file: /stuff/NetBSD/Cvs/src/usr.bin/make/compat.c,v
retrieving revision 1.68
diff -u -p -r1.68 compat.c
--- compat.c    5 Oct 2007 15:27:45 -0000       1.68
+++ compat.c    25 Oct 2007 00:48:00 -0000
@@ -259,7 +259,7 @@ CompatRunCommand(ClientData cmdp, Client
     while ((*cmd == '@') || (*cmd == '-') || (*cmd == '+')) {
        switch (*cmd) {
        case '@':
-           silent = TRUE;
+           silent = DEBUG(LOUD) ? FALSE : TRUE;
            break;
        case '-':
            errCheck = FALSE;
Index: job.c
===================================================================
RCS file: /stuff/NetBSD/Cvs/src/usr.bin/make/job.c,v
retrieving revision 1.133
diff -u -p -r1.133 job.c
--- job.c       14 Oct 2007 20:22:53 -0000      1.133
+++ job.c       25 Oct 2007 00:48:27 -0000
@@ -710,7 +710,7 @@ JobPrintCommand(ClientData cmdp, ClientD
     while (*cmd == '@' || *cmd == '-' || (*cmd == '+')) {
        switch (*cmd) {
        case '@':
-           shutUp = TRUE;
+           shutUp = DEBUG(LOUD) ? FALSE : TRUE;
            break;
        case '-':
            errOff = TRUE;
Index: main.c
===================================================================
RCS file: /stuff/NetBSD/Cvs/src/usr.bin/make/main.c,v
retrieving revision 1.144
diff -u -p -r1.144 main.c
--- main.c      13 Oct 2007 16:16:41 -0000      1.144
+++ main.c      25 Oct 2007 00:44:44 -0000
@@ -232,6 +232,9 @@ parse_debug_options(const char *argvalue
                case 'j':
                        debug |= DEBUG_JOB;
                        break;
+               case 'l':
+                       debug |= DEBUG_LOUD;
+                       break;
                case 'm':
                        debug |= DEBUG_MAKE;
                        break;
Index: make.1
===================================================================
RCS file: /stuff/NetBSD/Cvs/src/usr.bin/make/make.1,v
retrieving revision 1.134
diff -u -p -r1.134 make.1
--- make.1      8 Oct 2007 20:26:36 -0000       1.134
+++ make.1      25 Oct 2007 00:45:40 -0000
@@ -151,6 +151,10 @@ on error.
 Print the input graph before exiting on error.
 .It Ar j
 Print debugging information about running multiple shells.
+.It Ar l
+Print commands in Makefiles regardless of whether or not they are prefixed
+by @ or other "quiet" flags.
+Also known as "loud" behavior.
 .It Ar m
 Print debugging information about making targets, including modification
 dates.
Index: make.h
===================================================================
RCS file: /stuff/NetBSD/Cvs/src/usr.bin/make/make.h,v
retrieving revision 1.70
diff -u -p -r1.70 make.h
--- make.h      8 Oct 2007 20:26:36 -0000       1.70
+++ make.h      25 Oct 2007 00:46:39 -0000
@@ -421,6 +421,7 @@ extern int debug;
 #define DEBUG_FOR      0x0400
 #define DEBUG_SHELL    0x0800
 #define DEBUG_ERROR    0x1000
+#define DEBUG_LOUD     0x2000
 #define        DEBUG_GRAPH3    0x10000
 #define DEBUG_SCRIPT   0x20000
 #define DEBUG_PARSE    0x40000