Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make make(1): add more debug logging for suffix hand...



details:   https://anonhg.NetBSD.org/src/rev/94f11423093c
branches:  trunk
changeset: 957181:94f11423093c
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Nov 21 11:59:22 2020 +0000

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

 usr.bin/make/targ.c                      |  5 +++--
 usr.bin/make/unit-tests/suff-rebuild.exp |  4 ++++
 2 files changed, 7 insertions(+), 2 deletions(-)

diffs (55 lines):

diff -r 09a81bd3dcae -r 94f11423093c usr.bin/make/targ.c
--- a/usr.bin/make/targ.c       Sat Nov 21 11:55:57 2020 +0000
+++ b/usr.bin/make/targ.c       Sat Nov 21 11:59:22 2020 +0000
@@ -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 @@
     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 -r 09a81bd3dcae -r 94f11423093c usr.bin/make/unit-tests/suff-rebuild.exp
--- a/usr.bin/make/unit-tests/suff-rebuild.exp  Sat Nov 21 11:55:57 2020 +0000
+++ b/usr.bin/make/unit-tests/suff-rebuild.exp  Sat Nov 21 11:59:22 2020 +0000
@@ -8,6 +8,7 @@
 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 (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 @@
        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"...



Home | Main Index | Thread Index | Old Index