Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Jul 2009 23:33:35 +0000 (UTC)
From:      John Birrell <jb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r195300 - projects/jbuild/usr.bin/make
Message-ID:  <200907022333.n62NXZeM060783@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jb
Date: Thu Jul  2 23:33:34 2009
New Revision: 195300
URL: http://svn.freebsd.org/changeset/base/195300

Log:
  Add an extra debug level (w) to make it easier to determine what thing
  in the meta data caused a target to be out of date. Previously this was
  part of 'm', but that is very verbose.

Modified:
  projects/jbuild/usr.bin/make/main.c
  projects/jbuild/usr.bin/make/make.c
  projects/jbuild/usr.bin/make/util.h

Modified: projects/jbuild/usr.bin/make/main.c
==============================================================================
--- projects/jbuild/usr.bin/make/main.c	Thu Jul  2 22:52:10 2009	(r195299)
+++ projects/jbuild/usr.bin/make/main.c	Thu Jul  2 23:33:34 2009	(r195300)
@@ -458,6 +458,11 @@ rearg:
 				case 'v':
 					debug |= DEBUG_VAR;
 					break;
+#ifdef MAKE_IS_BUILD
+				case 'w':
+					debug |= DEBUG_WHY;
+					break;
+#endif
 				default:
 					warnx("illegal argument to d option "
 					    "-- %c", *modules);

Modified: projects/jbuild/usr.bin/make/make.c
==============================================================================
--- projects/jbuild/usr.bin/make/make.c	Thu Jul  2 22:52:10 2009	(r195299)
+++ projects/jbuild/usr.bin/make/make.c	Thu Jul  2 23:33:34 2009	(r195300)
@@ -350,7 +350,7 @@ Make_OODate(GNode *gn)
 						if (stat(p, &fs) == 0 &&
 						    !S_ISDIR(fs.st_mode) &&
 						    fs.st_mtime > gn->mtime) {
-							DEBUGF(MAKE, ("File '%s' is newer than the target...", p));
+							DEBUGF(WHY, ("File '%s' is newer than the target...", p));
 							oodate = TRUE;
 						}
 						break;
@@ -364,13 +364,13 @@ Make_OODate(GNode *gn)
 				 */
 				} else if (strcmp(bufr, "CMD") == 0) {
 					if (lnp == NULL) {
-						DEBUGF(MAKE, ("There were more build commands in the meta data file than there are now..."));
+						DEBUGF(WHY, ("There were more build commands in the meta data file than there are now..."));
 						oodate = TRUE;
 					} else {
 						char *cmd = Buf_Peel(Var_Subst(lnp->datum, gn, TRUE));
 
 						if (strcmp(p, cmd) != 0) {
-							DEBUGF(MAKE, ("A build command has changed\n%s\nvs\n%s\n... ", p, cmd));
+							DEBUGF(WHY, ("A build command has changed\n%s\nvs\n%s\n... ", p, cmd));
 							oodate = TRUE;
 						}
 
@@ -379,7 +379,7 @@ Make_OODate(GNode *gn)
 				} else if (strcmp(bufr, "CWD") == 0) {
 					char curdir[MAXPATHLEN];
 					if (strcmp(p, getcwd(curdir, sizeof(curdir))) != 0) {
-						DEBUGF(MAKE, ("The current working directory has changed from '%s' to '%s'.. ", p, curdir));
+						DEBUGF(WHY, ("The current working directory has changed from '%s' to '%s'.. ", p, curdir));
 						oodate = TRUE;
 					}
 				}
@@ -390,7 +390,7 @@ Make_OODate(GNode *gn)
 			 * data file.
 			 */
 			if (!oodate && lnp != NULL) {
-				DEBUGF(MAKE, ("There are extra build commands now that weren't in the meta data file"));
+				DEBUGF(WHY, ("There are extra build commands now that weren't in the meta data file"));
 				oodate = TRUE;
 			}
 

Modified: projects/jbuild/usr.bin/make/util.h
==============================================================================
--- projects/jbuild/usr.bin/make/util.h	Thu Jul  2 22:52:10 2009	(r195299)
+++ projects/jbuild/usr.bin/make/util.h	Thu Jul  2 23:33:34 2009	(r195300)
@@ -79,6 +79,9 @@ struct flag2str {
 #define	DEBUG_VAR	0x0200
 #define	DEBUG_FOR	0x0400
 #define	DEBUG_LOUD	0x0800
+#ifdef MAKE_IS_BUILD
+#define	DEBUG_WHY	0x1000
+#endif
 
 #define	DEBUG(module)	(debug & CONCAT(DEBUG_,module))
 #define	DEBUGF(module,args)		\



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