Module Name: src
Committed By: rillig
Date: Sat Sep 5 06:46:13 UTC 2020
Modified Files:
src/usr.bin/make: suff.c targ.c
src/usr.bin/make/unit-tests: opt-debug-graph1.exp opt-debug-graph1.mk
Log Message:
make(1): remove trailing whitespace in -dg1 debug output
To generate a diff of this commit:
cvs rdiff -u -r1.142 -r1.143 src/usr.bin/make/suff.c
cvs rdiff -u -r1.81 -r1.82 src/usr.bin/make/targ.c
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/opt-debug-graph1.exp \
src/usr.bin/make/unit-tests/opt-debug-graph1.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/suff.c
diff -u src/usr.bin/make/suff.c:1.142 src/usr.bin/make/suff.c:1.143
--- src/usr.bin/make/suff.c:1.142 Mon Aug 31 16:44:25 2020
+++ src/usr.bin/make/suff.c Sat Sep 5 06:46:12 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: suff.c,v 1.142 2020/08/31 16:44:25 rillig Exp $ */
+/* $NetBSD: suff.c,v 1.143 2020/09/05 06:46:12 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: suff.c,v 1.142 2020/08/31 16:44:25 rillig Exp $";
+static char rcsid[] = "$NetBSD: suff.c,v 1.143 2020/09/05 06:46:12 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94";
#else
-__RCSID("$NetBSD: suff.c,v 1.142 2020/08/31 16:44:25 rillig Exp $");
+__RCSID("$NetBSD: suff.c,v 1.143 2020/09/05 06:46:12 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -2234,7 +2234,7 @@ SuffPrintTrans(void *tp, void *dummy MAK
{
GNode *t = (GNode *)tp;
- fprintf(debug_file, "%-16s: ", t->name);
+ fprintf(debug_file, "%-16s:", t->name);
Targ_PrintType(t->type);
fputc('\n', debug_file);
Lst_ForEach(t->commands, Targ_PrintCmd, NULL);
Index: src/usr.bin/make/targ.c
diff -u src/usr.bin/make/targ.c:1.81 src/usr.bin/make/targ.c:1.82
--- src/usr.bin/make/targ.c:1.81 Tue Sep 1 20:54:00 2020
+++ src/usr.bin/make/targ.c Sat Sep 5 06:46:12 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: targ.c,v 1.81 2020/09/01 20:54:00 rillig Exp $ */
+/* $NetBSD: targ.c,v 1.82 2020/09/05 06:46:12 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: targ.c,v 1.81 2020/09/01 20:54:00 rillig Exp $";
+static char rcsid[] = "$NetBSD: targ.c,v 1.82 2020/09/05 06:46:12 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)targ.c 8.2 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: targ.c,v 1.81 2020/09/01 20:54:00 rillig Exp $");
+__RCSID("$NetBSD: targ.c,v 1.82 2020/09/05 06:46:12 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -406,8 +406,8 @@ Targ_PrintType(int type)
{
int tbit;
-#define PRINTBIT(attr) case CONCAT(OP_,attr): fprintf(debug_file, "." #attr " "); break
-#define PRINTDBIT(attr) case CONCAT(OP_,attr): if (DEBUG(TARG))fprintf(debug_file, "." #attr " "); break
+#define PRINTBIT(attr) case CONCAT(OP_,attr): fprintf(debug_file, " ." #attr); break
+#define PRINTDBIT(attr) case CONCAT(OP_,attr): if (DEBUG(TARG))fprintf(debug_file, " ." #attr); break
type &= ~OP_OPMASK;
@@ -428,7 +428,7 @@ Targ_PrintType(int type)
PRINTBIT(NOTMAIN);
PRINTDBIT(LIB);
/*XXX: MEMBER is defined, so CONCAT(OP_,MEMBER) gives OP_"%" */
- case OP_MEMBER: if (DEBUG(TARG))fprintf(debug_file, ".MEMBER "); break;
+ case OP_MEMBER: if (DEBUG(TARG))fprintf(debug_file, " .MEMBER"); break;
PRINTDBIT(ARCHV);
PRINTDBIT(MADE);
PRINTDBIT(PHONY);
@@ -515,11 +515,11 @@ Targ_PrintNode(void *gnp, void *passp)
fprintf(debug_file, "%-16s", gn->name);
switch (gn->type & OP_OPMASK) {
case OP_DEPENDS:
- fprintf(debug_file, ": "); break;
+ fprintf(debug_file, ":"); break;
case OP_FORCE:
- fprintf(debug_file, "! "); break;
+ fprintf(debug_file, "!"); break;
case OP_DOUBLEDEP:
- fprintf(debug_file, ":: "); break;
+ fprintf(debug_file, "::"); break;
}
Targ_PrintType(gn->type);
Lst_ForEach(gn->children, TargPrintName, NULL);
@@ -542,7 +542,7 @@ TargPrintOnlySrc(void *gnp, void *dummy
if (!OP_NOP(gn->type))
return 0;
- fprintf(debug_file, "#\t%s [%s] ",
+ fprintf(debug_file, "#\t%s [%s]",
gn->name, gn->path ? gn->path : gn->name);
Targ_PrintType(gn->type);
fprintf(debug_file, "\n");
Index: src/usr.bin/make/unit-tests/opt-debug-graph1.exp
diff -u src/usr.bin/make/unit-tests/opt-debug-graph1.exp:1.2 src/usr.bin/make/unit-tests/opt-debug-graph1.exp:1.3
--- src/usr.bin/make/unit-tests/opt-debug-graph1.exp:1.2 Sat Sep 5 06:36:40 2020
+++ src/usr.bin/make/unit-tests/opt-debug-graph1.exp Sat Sep 5 06:46:12 2020
@@ -5,11 +5,13 @@
# made-source, made UNMADE, type OP_DEPENDS, flags none
# unmade-target, made UNMADE, type OP_DEPENDS, flags none
# unmade-sources, made UNMADE, type none, flags none
+# unmade-silent-source, made UNMADE, type OP_SILENT, flags none
# unmade-target-no-sources, made UNMADE, type OP_DEPENDS, flags none
#
# Files that are only sources:
-# unmade-sources [unmade-sources]
+# unmade-sources [unmade-sources]
+# unmade-silent-source [unmade-silent-source] .SILENT
#*** Transformations:
exit status 0
Index: src/usr.bin/make/unit-tests/opt-debug-graph1.mk
diff -u src/usr.bin/make/unit-tests/opt-debug-graph1.mk:1.2 src/usr.bin/make/unit-tests/opt-debug-graph1.mk:1.3
--- src/usr.bin/make/unit-tests/opt-debug-graph1.mk:1.2 Sat Sep 5 06:36:40 2020
+++ src/usr.bin/make/unit-tests/opt-debug-graph1.mk Sat Sep 5 06:46:12 2020
@@ -1,4 +1,4 @@
-# $NetBSD: opt-debug-graph1.mk,v 1.2 2020/09/05 06:36:40 rillig Exp $
+# $NetBSD: opt-debug-graph1.mk,v 1.3 2020/09/05 06:46:12 rillig Exp $
#
# Tests for the -dg1 command line option, which prints the input
# graph before making anything.
@@ -13,7 +13,9 @@ made-source:
made-target-no-sources:
-unmade-target: unmade-sources
+unmade-target: unmade-sources unmade-silent-source
+
+.SILENT: unmade-silent-source
unmade-target-no-sources: