summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorrillig <rillig@NetBSD.org>2020-11-21 11:59:22 +0000
committerrillig <rillig@NetBSD.org>2020-11-21 11:59:22 +0000
commitbb7d4dfa13e22d8476ed6eba7bc5cedadcdbeb1a (patch)
treea638fbfaefe3615a8d50b02b7cdb54db926e3313 /usr.bin
parentab4f008136e5fca20e405a3d696839082fc17bae (diff)
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.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/make/targ.c5
-rw-r--r--usr.bin/make/unit-tests/suff-rebuild.exp4
2 files changed, 7 insertions, 2 deletions
diff --git a/usr.bin/make/targ.c b/usr.bin/make/targ.c
index 082e9be9e8c..3b8a26ad19c 100644
--- a/usr.bin/make/targ.c
+++ b/usr.bin/make/targ.c
@@ -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;
diff --git a/usr.bin/make/unit-tests/suff-rebuild.exp b/usr.bin/make/unit-tests/suff-rebuild.exp
index fa60212f282..1f00ab04a59 100644
--- a/usr.bin/make/unit-tests/suff-rebuild.exp
+++ b/usr.bin/make/unit-tests/suff-rebuild.exp
@@ -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} from ${.IMPSRC}.'
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"...