Module Name:    src
Committed By:   sjg
Date:           Sun Aug 28 03:54:07 UTC 2011

Modified Files:
        src/usr.bin/make: job.c make.1 meta.c

Log Message:
In meta mode, we create .meta files for most targets.
These capture all the interesting data - useful for debugging.
In such cases there is no need to replicate commands in the build log.
Rather than run the entire build .SILENT, allow meta mode to set that flag
per target iff a .meta file is created.
Normal behavior is retained for targets where no .meta file is created,
ensuring that no build data is lost.


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/usr.bin/make/job.c
cvs rdiff -u -r1.194 -r1.195 src/usr.bin/make/make.1
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/make/meta.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/job.c
diff -u src/usr.bin/make/job.c:1.158 src/usr.bin/make/job.c:1.159
--- src/usr.bin/make/job.c:1.158	Sun Aug 14 13:06:09 2011
+++ src/usr.bin/make/job.c	Sun Aug 28 03:54:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.c,v 1.158 2011/08/14 13:06:09 christos Exp $	*/
+/*	$NetBSD: job.c,v 1.159 2011/08/28 03:54:07 sjg 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.158 2011/08/14 13:06:09 christos Exp $";
+static char rcsid[] = "$NetBSD: job.c,v 1.159 2011/08/28 03:54:07 sjg 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.158 2011/08/14 13:06:09 christos Exp $");
+__RCSID("$NetBSD: job.c,v 1.159 2011/08/28 03:54:07 sjg Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1592,6 +1592,9 @@
 #ifdef USE_META
 	if (useMeta) {
 	    meta_job_start(job, gn);
+	    if (Targ_Silent(gn)) {	/* might have changed */
+		job->flags |= JOB_SILENT;
+	    }
 	}
 #endif
 	/*

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.194 src/usr.bin/make/make.1:1.195
--- src/usr.bin/make/make.1:1.194	Thu Aug 18 15:36:51 2011
+++ src/usr.bin/make/make.1	Sun Aug 28 03:54:07 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.194 2011/08/18 15:36:51 sjg Exp $
+.\"	$NetBSD: make.1,v 1.195 2011/08/28 03:54:07 sjg Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	from: @(#)make.1	8.4 (Berkeley) 3/19/94
 .\"
-.Dd August 18, 2011
+.Dd August 28, 2011
 .Dt MAKE 1
 .Os
 .Sh NAME
@@ -799,6 +799,10 @@
 determining whether a target is out of date in "meta" mode.
 See also
 .Ic .NOMETA_CMP .
+.It Pa silent= Ar bf
+If
+.Va bf
+is True, when a .meta file is created, mark the target
 .El
 .It Va .MAKE.META.BAILIWICK
 In "meta" mode, provides a list of prefixes which

Index: src/usr.bin/make/meta.c
diff -u src/usr.bin/make/meta.c:1.21 src/usr.bin/make/meta.c:1.22
--- src/usr.bin/make/meta.c:1.21	Thu Aug 18 00:00:21 2011
+++ src/usr.bin/make/meta.c	Sun Aug 28 03:54:07 2011
@@ -1,4 +1,4 @@
-/*      $NetBSD: meta.c,v 1.21 2011/08/18 00:00:21 sjg Exp $ */
+/*      $NetBSD: meta.c,v 1.22 2011/08/28 03:54:07 sjg Exp $ */
 
 /*
  * Implement 'meta' mode.
@@ -64,6 +64,7 @@
 static Boolean metaVerbose = FALSE;
 static Boolean metaIgnoreCMDs = FALSE;	/* ignore CMDs in .meta files */
 static Boolean metaCurdirOk = FALSE;	/* write .meta in .CURDIR Ok? */
+static Boolean metaSilent = FALSE;	/* if we have a .meta be SILENT */
 
 extern Boolean forceJobs;
 extern Boolean comatMake;
@@ -510,7 +511,11 @@
 
     Var_Append(".MAKE.META.FILES", fname, VAR_GLOBAL);
     Var_Append(".MAKE.META.CREATED", fname, VAR_GLOBAL);
-    
+
+    gn->type |= OP_META;		/* in case anyone wants to know */
+    if (metaSilent) {
+	    gn->type |= OP_SILENT;
+    }
  out:
     for (i--; i >= 0; i--) {
 	if (p[i])
@@ -556,6 +561,9 @@
 	if ((cp = strstr(make_mode, "curdirok="))) {
 	    metaCurdirOk = boolValue(&cp[9]);
 	}
+	if ((cp = strstr(make_mode, "silent="))) {
+	    metaSilent = boolValue(&cp[7]);
+	}
 	if (strstr(make_mode, "ignore-cmd"))
 	    metaIgnoreCMDs = TRUE;
 	/* for backwards compatability */

Reply via email to