aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Khon <fjoe@FreeBSD.org>2009-10-18 11:28:31 +0000
committerMax Khon <fjoe@FreeBSD.org>2009-10-18 11:28:31 +0000
commitab5f4f723dbe884cc1b85441d921dbbb0330b21b (patch)
tree0fed040c6b5785fcde6b17eb5f0e5594ee2c0ae5
parent33c89765f15cbb17c34f612e89ecebbaaafc47b7 (diff)
downloadsrc-ab5f4f723dbe884cc1b85441d921dbbb0330b21b.tar.gz
src-ab5f4f723dbe884cc1b85441d921dbbb0330b21b.zip
Reset UPTODATE gnodes after remaking makefiles when make
is not going to be restarted: such nodes could be marked UPTODATE without doing rebuild due to remakingMakefiles being TRUE.
Notes
Notes: svn path=/head/; revision=198199
-rw-r--r--usr.bin/make/main.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c
index 0e165062c1bb..eec6bbf1e247 100644
--- a/usr.bin/make/main.c
+++ b/usr.bin/make/main.c
@@ -706,6 +706,7 @@ Main_AddSourceMakefile(const char *name)
static void
Remake_Makefiles(void)
{
+ Lst cleanup;
LstNode *ln;
int error_cnt = 0;
int remade_cnt = 0;
@@ -716,6 +717,7 @@ Remake_Makefiles(void)
Fatal("Failed to change directory to %s.", curdir);
}
+ Lst_Init(&cleanup);
LST_FOREACH(ln, &source_makefiles) {
LstNode *ln2;
struct GNode *gn;
@@ -791,21 +793,7 @@ Remake_Makefiles(void)
gn->name);
error_cnt++;
} else if (gn->made == UPTODATE) {
- Lst examine;
-
- Lst_Init(&examine);
- Lst_EnQueue(&examine, gn);
- while (!Lst_IsEmpty(&examine)) {
- LstNode *eln;
- GNode *egn = Lst_DeQueue(&examine);
-
- egn->make = FALSE;
- LST_FOREACH(eln, &egn->children) {
- GNode *cgn = Lst_Datum(eln);
-
- Lst_EnQueue(&examine, cgn);
- }
- }
+ Lst_EnQueue(&cleanup, gn);
}
}
@@ -827,6 +815,24 @@ Remake_Makefiles(void)
}
}
+ while (!Lst_IsEmpty(&cleanup)) {
+ GNode *gn = Lst_DeQueue(&cleanup);
+
+ gn->unmade = 0;
+ gn->make = FALSE;
+ gn->made = UNMADE;
+ gn->childMade = FALSE;
+ gn->mtime = gn->cmtime = 0;
+ gn->cmtime_gn = NULL;
+
+ LST_FOREACH(ln, &gn->children) {
+ GNode *cgn = Lst_Datum(ln);
+
+ gn->unmade++;
+ Lst_EnQueue(&cleanup, cgn);
+ }
+ }
+
if (curdir != objdir) {
if (chdir(objdir) < 0)
Fatal("Failed to change directory to %s.", objdir);