Module Name:    src
Committed By:   christos
Date:           Tue Mar  5 02:04:11 UTC 2013

Modified Files:
        src/usr.bin/make: dir.c job.c parse.c

Log Message:
Keep track of the location where a dependency is defined, so we can report
about it.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/usr.bin/make/dir.c
cvs rdiff -u -r1.170 -r1.171 src/usr.bin/make/job.c
cvs rdiff -u -r1.185 -r1.186 src/usr.bin/make/parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/dir.c
diff -u src/usr.bin/make/dir.c:1.65 src/usr.bin/make/dir.c:1.66
--- src/usr.bin/make/dir.c:1.65	Tue Jun 12 15:21:50 2012
+++ src/usr.bin/make/dir.c	Mon Mar  4 21:04:10 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.c,v 1.65 2012/06/12 19:21:50 joerg Exp $	*/
+/*	$NetBSD: dir.c,v 1.66 2013/03/05 02:04:10 christos Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: dir.c,v 1.65 2012/06/12 19:21:50 joerg Exp $";
+static char rcsid[] = "$NetBSD: dir.c,v 1.66 2013/03/05 02:04:10 christos Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)dir.c	8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: dir.c,v 1.65 2012/06/12 19:21:50 joerg Exp $");
+__RCSID("$NetBSD: dir.c,v 1.66 2013/03/05 02:04:10 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1464,8 +1464,9 @@ Dir_MTime(GNode *gn, Boolean recheck)
 			 */
 			gn->path = bmake_strdup(fullName);
 			fprintf(stdout,
-				"%s: ignoring stale %s for %s, found %s\n",
-				progname, makeDependfile, gn->name, fullName);
+			    "%s: %s, %d: ignoring stale %s for %s, found %s\n",
+			    progname, gn->fname, gn->lineno,
+			    makeDependfile, gn->name, fullName);
 		    }
 		}
 	    }

Index: src/usr.bin/make/job.c
diff -u src/usr.bin/make/job.c:1.170 src/usr.bin/make/job.c:1.171
--- src/usr.bin/make/job.c:1.170	Mon Feb 25 19:45:27 2013
+++ src/usr.bin/make/job.c	Mon Mar  4 21:04:10 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.c,v 1.170 2013/02/26 00:45:27 christos Exp $	*/
+/*	$NetBSD: job.c,v 1.171 2013/03/05 02:04:10 christos Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: job.c,v 1.170 2013/02/26 00:45:27 christos Exp $";
+static char rcsid[] = "$NetBSD: job.c,v 1.171 2013/03/05 02:04:10 christos Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)job.c	8.2 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: job.c,v 1.170 2013/02/26 00:45:27 christos Exp $");
+__RCSID("$NetBSD: job.c,v 1.171 2013/03/05 02:04:10 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1232,8 +1232,8 @@ Job_CheckCommands(GNode *gn, void (*abor
 	    static const char msg[] = ": don't know how to make";
 
 	    if (gn->flags & FROM_DEPEND) {
-		fprintf(stdout, "%s: ignoring stale %s for %s\n",
-			progname, makeDependfile, gn->name);
+		fprintf(stdout, "%s: %s, %d: ignoring stale %s for %s\n",
+		    progname, gn->fname, gn->lineno, makeDependfile, gn->name);
 		return TRUE;
 	    }
 

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.185 src/usr.bin/make/parse.c:1.186
--- src/usr.bin/make/parse.c:1.185	Tue Jun 12 15:21:51 2012
+++ src/usr.bin/make/parse.c	Mon Mar  4 21:04:11 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.185 2012/06/12 19:21:51 joerg Exp $	*/
+/*	$NetBSD: parse.c,v 1.186 2013/03/05 02:04:11 christos Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.185 2012/06/12 19:21:51 joerg Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.186 2013/03/05 02:04:11 christos Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)parse.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: parse.c,v 1.185 2012/06/12 19:21:51 joerg Exp $");
+__RCSID("$NetBSD: parse.c,v 1.186 2013/03/05 02:04:11 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -905,6 +905,8 @@ ParseDoOp(void *gnp, void *opp)
 	gn->type |= op & ~OP_OPMASK;
 
 	cohort = Targ_FindNode(gn->name, TARG_NOHASH);
+	if (doing_depend)
+	    ParseMark(cohort);
 	/*
 	 * Make the cohort invisible as well to avoid duplicating it into
 	 * other variables. True, parents of this target won't tend to do
@@ -977,6 +979,8 @@ ParseDoSrc(int tOp, const char *src)
 		 */
 		snprintf(wait_src, sizeof wait_src, ".WAIT_%u", ++wait_number);
 		gn = Targ_FindNode(wait_src, TARG_NOHASH);
+		if (doing_depend)
+		    ParseMark(gn);
 		gn->type = OP_WAIT | OP_PHONY | OP_DEPENDS | OP_NOTMAIN;
 		Lst_ForEach(targets, ParseLinkSrc, gn);
 		return;
@@ -1008,6 +1012,8 @@ ParseDoSrc(int tOp, const char *src)
 	 * source and the current one.
 	 */
 	gn = Targ_FindNode(src, TARG_CREATE);
+	if (doing_depend)
+	    ParseMark(gn);
 	if (predecessor != NULL) {
 	    (void)Lst_AtEnd(predecessor->order_succ, gn);
 	    (void)Lst_AtEnd(gn->order_pred, predecessor);
@@ -1039,6 +1045,8 @@ ParseDoSrc(int tOp, const char *src)
 
 	/* Find/create the 'src' node and attach to all targets */
 	gn = Targ_FindNode(src, TARG_CREATE);
+	if (doing_depend)
+	    ParseMark(gn);
 	if (tOp) {
 	    gn->type |= tOp;
 	} else {
@@ -1310,6 +1318,8 @@ ParseDoDependency(char *line)
 		    case dotError:
 		    case Interrupt:
 			gn = Targ_FindNode(line, TARG_CREATE);
+			if (doing_depend)
+			    ParseMark(gn);
 			gn->type |= OP_NOTMAIN|OP_SPECIAL;
 			(void)Lst_AtEnd(targets, gn);
 			break;
@@ -1388,6 +1398,8 @@ ParseDoDependency(char *line)
 		} else {
 		    gn = Suff_AddTransform(targName);
 		}
+		if (doing_depend)
+		    ParseMark(gn);
 
 		(void)Lst_AtEnd(targets, gn);
 	    }

Reply via email to