Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make Debug trace all the targets we are actually int...



details:   https://anonhg.NetBSD.org/src/rev/f9b7ea98fa70
branches:  trunk
changeset: 588201:f9b7ea98fa70
user:      dsl <dsl%NetBSD.org@localhost>
date:      Sat Feb 11 18:37:36 2006 +0000

description:
Debug trace all the targets we are actually intending making.
De-optimise the getting of a job token so we don't re-order the job
list when there are no tokens.
This might have helped etc/Makefile, but isn't enough.

diffstat:

 usr.bin/make/make.c    |  21 ++++++++++++---------
 usr.bin/make/nonints.h |   3 ++-
 usr.bin/make/targ.c    |  16 ++++++++--------
 3 files changed, 22 insertions(+), 18 deletions(-)

diffs (138 lines):

diff -r caea7d936f1c -r f9b7ea98fa70 usr.bin/make/make.c
--- a/usr.bin/make/make.c       Sat Feb 11 18:36:20 2006 +0000
+++ b/usr.bin/make/make.c       Sat Feb 11 18:37:36 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.c,v 1.59 2006/01/04 21:16:53 dsl Exp $    */
+/*     $NetBSD: make.c,v 1.60 2006/02/11 18:37:36 dsl Exp $    */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: make.c,v 1.59 2006/01/04 21:16:53 dsl Exp $";
+static char rcsid[] = "$NetBSD: make.c,v 1.60 2006/02/11 18:37:36 dsl Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)make.c     8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: make.c,v 1.59 2006/01/04 21:16:53 dsl Exp $");
+__RCSID("$NetBSD: make.c,v 1.60 2006/02/11 18:37:36 dsl Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -934,6 +934,11 @@
     int                have_token = 0;
 
     while (!Lst_IsEmpty (toBeMade)) {
+       /* Get token now to avoid cycling job-list when we only have 1 token */
+       if (!have_token && !Job_TokenWithdraw())
+           break;
+       have_token = 1;
+
        gn = (GNode *)Lst_DeQueue(toBeMade);
        if (DEBUG(MAKE)) {
            printf("Examining %s...", gn->name);
@@ -967,12 +972,6 @@
            }
        }
 
-       if (!have_token && !Job_TokenWithdraw()) {
-           Lst_AtFront(toBeMade, gn);
-           break;
-       }
-       have_token = 1;
-
        numNodes--;
        if (Make_OODate(gn)) {
            if (DEBUG(MAKE)) {
@@ -1192,6 +1191,10 @@
     int                    errors;     /* Number of errors the Job module reports */
 
     toBeMade = Make_ExpandUse(targs);
+    if (DEBUG(MAKE)) {
+        printf("#***# toBeMade\n");
+        Lst_ForEach(toBeMade, Targ_PrintNode, 0);
+    }
 
     if (queryFlag) {
        /*
diff -r caea7d936f1c -r f9b7ea98fa70 usr.bin/make/nonints.h
--- a/usr.bin/make/nonints.h    Sat Feb 11 18:36:20 2006 +0000
+++ b/usr.bin/make/nonints.h    Sat Feb 11 18:37:36 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nonints.h,v 1.34 2005/05/08 00:38:47 christos Exp $    */
+/*     $NetBSD: nonints.h,v 1.35 2006/02/11 18:37:36 dsl Exp $ */
 
 /*-
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -172,6 +172,7 @@
 Boolean Targ_Precious(GNode *);
 void Targ_SetMain(GNode *);
 int Targ_PrintCmd(ClientData, ClientData);
+int Targ_PrintNode(ClientData, ClientData);
 char *Targ_FmtTime(time_t);
 void Targ_PrintType(int);
 void Targ_PrintGraph(int);
diff -r caea7d936f1c -r f9b7ea98fa70 usr.bin/make/targ.c
--- a/usr.bin/make/targ.c       Sat Feb 11 18:36:20 2006 +0000
+++ b/usr.bin/make/targ.c       Sat Feb 11 18:37:36 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: targ.c,v 1.39 2006/01/08 17:43:31 dsl Exp $    */
+/*     $NetBSD: targ.c,v 1.40 2006/02/11 18:37:36 dsl Exp $    */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: targ.c,v 1.39 2006/01/08 17:43:31 dsl Exp $";
+static char rcsid[] = "$NetBSD: targ.c,v 1.40 2006/02/11 18:37:36 dsl 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.39 2006/01/08 17:43:31 dsl Exp $");
+__RCSID("$NetBSD: targ.c,v 1.40 2006/02/11 18:37:36 dsl Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -618,11 +618,11 @@
  *     print the contents of a node
  *-----------------------------------------------------------------------
  */
-static int
-TargPrintNode(ClientData gnp, ClientData passp)
+int
+Targ_PrintNode(ClientData gnp, ClientData passp)
 {
     GNode         *gn = (GNode *)gnp;
-    int                  pass = *(int *)passp;
+    int                  pass = passp ? *(int *)passp : 0;
     if (!OP_NOP(gn->type)) {
        printf("#\n");
        if (gn == mainTarg) {
@@ -689,7 +689,7 @@
        Lst_ForEach(gn->commands, Targ_PrintCmd, (ClientData)0);
        printf("\n\n");
        if (gn->type & OP_DOUBLEDEP) {
-           Lst_ForEach(gn->cohorts, TargPrintNode, (ClientData)&pass);
+           Lst_ForEach(gn->cohorts, Targ_PrintNode, (ClientData)&pass);
        }
     }
     return (0);
@@ -738,7 +738,7 @@
 Targ_PrintGraph(int pass)
 {
     printf("#*** Input graph:\n");
-    Lst_ForEach(allTargets, TargPrintNode, (ClientData)&pass);
+    Lst_ForEach(allTargets, Targ_PrintNode, (ClientData)&pass);
     printf("\n\n");
     printf("#\n#   Files that are only sources:\n");
     Lst_ForEach(allTargets, TargPrintOnlySrc, (ClientData) 0);



Home | Main Index | Thread Index | Old Index