diff options
| author | dsl <dsl@NetBSD.org> | 2006-02-11 18:37:36 +0000 |
|---|---|---|
| committer | dsl <dsl@NetBSD.org> | 2006-02-11 18:37:36 +0000 |
| commit | 49c83bef6a73449e82fffd3905be554014b4cce3 (patch) | |
| tree | 8aff6d9d4bd2df722feae103cc4157a7e88a8d30 /usr.bin/make | |
| parent | f0bf09cccc737df03aaba3e221ff09ba6d0f4ec8 (diff) | |
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 (limited to 'usr.bin/make')
| -rw-r--r-- | usr.bin/make/make.c | 21 | ||||
| -rw-r--r-- | usr.bin/make/nonints.h | 3 | ||||
| -rw-r--r-- | usr.bin/make/targ.c | 16 |
3 files changed, 22 insertions, 18 deletions
diff --git a/usr.bin/make/make.c b/usr.bin/make/make.c index c4af329171a..5261939f12b 100644 --- a/usr.bin/make/make.c +++ b/usr.bin/make/make.c @@ -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 @@ MakeStartJobs(void) 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 @@ MakeStartJobs(void) } } - 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 @@ Make_Run(Lst targs) 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 --git a/usr.bin/make/nonints.h b/usr.bin/make/nonints.h index df231534f7d..e55a892303a 100644 --- a/usr.bin/make/nonints.h +++ b/usr.bin/make/nonints.h @@ -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_Silent(GNode *); 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 --git a/usr.bin/make/targ.c b/usr.bin/make/targ.c index 7c441c03690..088f8d6f96f 100644 --- a/usr.bin/make/targ.c +++ b/usr.bin/make/targ.c @@ -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 @@ Targ_PrintType(int type) * 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 @@ TargPrintNode(ClientData gnp, ClientData passp) 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 @@ void 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); |
