Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Oct 2009 11:28:32 +0000 (UTC)
From:      Max Khon <fjoe@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r198199 - head/usr.bin/make
Message-ID:  <200910181128.n9IBSWfI067684@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: fjoe
Date: Sun Oct 18 11:28:31 2009
New Revision: 198199
URL: http://svn.freebsd.org/changeset/base/198199

Log:
  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.

Modified:
  head/usr.bin/make/main.c

Modified: head/usr.bin/make/main.c
==============================================================================
--- head/usr.bin/make/main.c	Sun Oct 18 11:27:34 2009	(r198198)
+++ head/usr.bin/make/main.c	Sun Oct 18 11:28:31 2009	(r198199)
@@ -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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910181128.n9IBSWfI067684>