=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/make/make.c,v retrieving revision 1.47 retrieving revision 1.48 diff -c -r1.47 -r1.48 *** src/usr.bin/make/make.c 2007/11/06 21:12:23 1.47 --- src/usr.bin/make/make.c 2007/11/10 12:51:40 1.48 *************** *** 1,5 **** /* $OpenPackages$ */ ! /* $OpenBSD: make.c,v 1.47 2007/11/06 21:12:23 espie Exp $ */ /* $NetBSD: make.c,v 1.10 1996/11/06 17:59:15 christos Exp $ */ /* --- 1,5 ---- /* $OpenPackages$ */ ! /* $OpenBSD: make.c,v 1.48 2007/11/10 12:51:40 espie Exp $ */ /* $NetBSD: make.c,v 1.10 1996/11/06 17:59:15 christos Exp $ */ /* *************** *** 107,113 **** GNode *to_add = (GNode *)to_addp; Lst l = (Lst)lp; ! if (!to_add->make && !(to_add->type & OP_USE)) Lst_EnQueue(l, to_add); } --- 107,113 ---- GNode *to_add = (GNode *)to_addp; Lst l = (Lst)lp; ! if (!to_add->must_make && !(to_add->type & OP_USE)) Lst_EnQueue(l, to_add); } *************** *** 153,159 **** * now -- some rules won't actually update the file. If the file still * doesn't exist, make its mtime now. */ ! if (cgn->made != UPTODATE) { /* * This is what Make does and it's actually a good thing, as it * allows rules like --- 153,159 ---- * now -- some rules won't actually update the file. If the file still * doesn't exist, make its mtime now. */ ! if (cgn->built_status != UPTODATE) { /* * This is what Make does and it's actually a good thing, as it * allows rules like *************** *** 176,186 **** for (ln = Lst_First(&cgn->parents); ln != NULL; ln = Lst_Adv(ln)) { pgn = (GNode *)Lst_Datum(ln); ! if (pgn->make) { pgn->unmade--; if ( ! (cgn->type & (OP_EXEC|OP_USE))) { ! if (cgn->made == MADE) { pgn->childMade = true; if (is_strictly_before(pgn->cmtime, cgn->mtime)) --- 176,186 ---- for (ln = Lst_First(&cgn->parents); ln != NULL; ln = Lst_Adv(ln)) { pgn = (GNode *)Lst_Datum(ln); ! if (pgn->must_make) { pgn->unmade--; if ( ! (cgn->type & (OP_EXEC|OP_USE))) { ! if (cgn->built_status == MADE) { pgn->childMade = true; if (is_strictly_before(pgn->cmtime, cgn->mtime)) *************** *** 208,214 **** for (ln = Lst_First(&cgn->successors); ln != NULL; ln = Lst_Adv(ln)) { GNode *succ = (GNode *)Lst_Datum(ln); ! if (succ->make && succ->unmade == 0 && succ->made == UNMADE) (void)Lst_QueueNew(&toBeMade, succ); } } --- 208,215 ---- for (ln = Lst_First(&cgn->successors); ln != NULL; ln = Lst_Adv(ln)) { GNode *succ = (GNode *)Lst_Datum(ln); ! if (succ->must_make && succ->unmade == 0 ! && succ->built_status == UNMADE) (void)Lst_QueueNew(&toBeMade, succ); } } *************** *** 228,234 **** for (ln = Lst_First(&gn->preds); ln != NULL; ln = Lst_Adv(ln)){ GNode *pgn = (GNode *)Lst_Datum(ln); ! if (pgn->make && pgn->made == UNMADE) { if (DEBUG(MAKE)) printf( "predecessor %s not made yet.\n", --- 229,235 ---- for (ln = Lst_First(&gn->preds); ln != NULL; ln = Lst_Adv(ln)){ GNode *pgn = (GNode *)Lst_Datum(ln); ! if (pgn->must_make && pgn->built_status == UNMADE) { if (DEBUG(MAKE)) printf( "predecessor %s not made yet.\n", *************** *** 258,264 **** } else { if (DEBUG(MAKE)) printf("up-to-date\n"); ! gn->made = UPTODATE; if (gn->type & OP_JOIN) { /* * Even for an up-to-date .JOIN node, we need it --- 259,265 ---- } else { if (DEBUG(MAKE)) printf("up-to-date\n"); ! gn->built_status = UPTODATE; if (gn->type & OP_JOIN) { /* * Even for an up-to-date .JOIN node, we need it *************** *** 322,328 **** { GNode *gn = (GNode *)gnp; bool cycle = *(bool *)cyclep; ! if (gn->made == UPTODATE) { printf("`%s' is up to date.\n", gn->name); } else if (gn->unmade != 0) { if (cycle) { --- 323,329 ---- { GNode *gn = (GNode *)gnp; bool cycle = *(bool *)cyclep; ! if (gn->built_status == UPTODATE) { printf("`%s' is up to date.\n", gn->name); } else if (gn->unmade != 0) { if (cycle) { *************** *** 337,349 **** * will cause this to erroneously complain about a * being in the cycle, but this is a good approximation. */ ! if (gn->made == CYCLE) { Error("Graph cycles through `%s'", gn->name); ! gn->made = ENDCYCLE; Lst_ForEach(&gn->children, MakePrintStatus, &t); ! gn->made = UNMADE; ! } else if (gn->made != ENDCYCLE) { ! gn->made = CYCLE; Lst_ForEach(&gn->children, MakePrintStatus, &t); } } else { --- 338,350 ---- * will cause this to erroneously complain about a * being in the cycle, but this is a good approximation. */ ! if (gn->built_status == CYCLE) { Error("Graph cycles through `%s'", gn->name); ! gn->built_status = ENDCYCLE; Lst_ForEach(&gn->children, MakePrintStatus, &t); ! gn->built_status = UNMADE; ! } else if (gn->built_status != ENDCYCLE) { ! gn->built_status = CYCLE; Lst_ForEach(&gn->children, MakePrintStatus, &t); } } else { *************** *** 370,377 **** Lst_Clone(&examine, targs, NOCOPY); while ((gn = (GNode *)Lst_DeQueue(&examine)) != NULL) { ! if (!gn->make) { ! gn->make = true; numNodes++; look_harder_for_target(gn); --- 371,378 ---- Lst_Clone(&examine, targs, NOCOPY); while ((gn = (GNode *)Lst_DeQueue(&examine)) != NULL) { ! if (!gn->must_make) { ! gn->must_make = true; numNodes++; look_harder_for_target(gn); *************** *** 408,414 **** * true if work was done. false otherwise. * * Side Effects: ! * The make field of all nodes involved in the creation of the given * targets is set to 1. The toBeMade list is set to contain all the * 'leaves' of these subgraphs. *----------------------------------------------------------------------- --- 409,415 ---- * true if work was done. false otherwise. * * Side Effects: ! * The must_make field of all nodes involved in the creation of the given * targets is set to 1. The toBeMade list is set to contain all the * 'leaves' of these subgraphs. *-----------------------------------------------------------------------