Module Name: src
Committed By: rillig
Date: Sat Nov 21 11:59:22 UTC 2020
Modified Files:
src/usr.bin/make: targ.c
src/usr.bin/make/unit-tests: suff-rebuild.exp
Log Message:
make(1): add more debug logging for suffix handling
One notable thing is that there is no debug output when adding a
transformation rule like ".c.o", which means that these rules don't end
up in the global allTargets variable.
This may or may not be intentional. It seems not intentional since this
is one of the causes for the suff-rebuild test to behave unexpectedly.
To generate a diff of this commit:
cvs rdiff -u -r1.137 -r1.138 src/usr.bin/make/targ.c
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/suff-rebuild.exp
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/targ.c
diff -u src/usr.bin/make/targ.c:1.137 src/usr.bin/make/targ.c:1.138
--- src/usr.bin/make/targ.c:1.137 Sat Nov 21 10:56:17 2020
+++ src/usr.bin/make/targ.c Sat Nov 21 11:59:22 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: targ.c,v 1.137 2020/11/21 10:56:17 rillig Exp $ */
+/* $NetBSD: targ.c,v 1.138 2020/11/21 11:59:22 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -119,7 +119,7 @@
#include "dir.h"
/* "@(#)targ.c 8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: targ.c,v 1.137 2020/11/21 10:56:17 rillig Exp $");
+MAKE_RCSID("$NetBSD: targ.c,v 1.138 2020/11/21 11:59:22 rillig Exp $");
/*
* All target nodes that appeared on the left-hand side of one of the
@@ -289,6 +289,7 @@ Targ_NewInternalNode(const char *name)
GNode *gn = GNode_New(name);
Var_Append(".ALLTARGETS", name, VAR_GLOBAL);
Lst_Append(allTargets, gn);
+ DEBUG1(TARG, "Adding \"%s\" to all targets.\n", gn->name);
if (doing_depend)
gn->flags |= FROM_DEPEND;
return gn;
Index: src/usr.bin/make/unit-tests/suff-rebuild.exp
diff -u src/usr.bin/make/unit-tests/suff-rebuild.exp:1.3 src/usr.bin/make/unit-tests/suff-rebuild.exp:1.4
--- src/usr.bin/make/unit-tests/suff-rebuild.exp:1.3 Sat Nov 21 11:55:57 2020
+++ src/usr.bin/make/unit-tests/suff-rebuild.exp Sat Nov 21 11:59:22 2020
@@ -8,6 +8,7 @@ Adding suffix ".b"
Adding suffix ".c"
ParseReadLine (14): 'suff-rebuild-example.a:'
ParseDoDependency(suff-rebuild-example.a:)
+Adding "suff-rebuild-example.a" to all targets.
ParseReadLine (15): ' : Making ${.TARGET} out of nothing.'
ParseReadLine (17): '.a.b:'
ParseDoDependency(.a.b:)
@@ -32,6 +33,7 @@ ParseReadLine (22): ' : Making ${.TARGET
ParseReadLine (35): '.SUFFIXES: .c .b .a'
transformation .c complete
ParseDoDependency(.SUFFIXES: .c .b .a)
+Adding ".END" to all targets.
Wildcard expanding "all"...
SuffFindDeps (all)
No known suffix on all. Using .NULL suffix
@@ -46,7 +48,9 @@ adding suffix rules
trying suff-rebuild-example.c...not there
trying suff-rebuild-example.b...not there
trying suff-rebuild-example.a...got it
+Adding "suff-rebuild-example.b" to all targets.
applying .a -> .b to "suff-rebuild-example.b"
+Adding "suff-rebuild-example.c" to all targets.
applying .b -> .c to "suff-rebuild-example.c"
applying .c -> to "suff-rebuild-example"
suffix is ".c"...