Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make In meta mode, we create .meta files for most ta...



details:   https://anonhg.NetBSD.org/src/rev/c4f0aaca53d3
branches:  trunk
changeset: 768854:c4f0aaca53d3
user:      sjg <sjg%NetBSD.org@localhost>
date:      Sun Aug 28 03:54:07 2011 +0000

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

diffstat:

 usr.bin/make/job.c  |   9 ++++++---
 usr.bin/make/make.1 |   8 ++++++--
 usr.bin/make/meta.c |  12 ++++++++++--
 3 files changed, 22 insertions(+), 7 deletions(-)

diffs (105 lines):

diff -r dc1538dd67c2 -r c4f0aaca53d3 usr.bin/make/job.c
--- a/usr.bin/make/job.c        Sun Aug 28 01:17:47 2011 +0000
+++ b/usr.bin/make/job.c        Sun Aug 28 03:54:07 2011 +0000
@@ -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
        /*
diff -r dc1538dd67c2 -r c4f0aaca53d3 usr.bin/make/make.1
--- a/usr.bin/make/make.1       Sun Aug 28 01:17:47 2011 +0000
+++ b/usr.bin/make/make.1       Sun Aug 28 03:54:07 2011 +0000
@@ -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
diff -r dc1538dd67c2 -r c4f0aaca53d3 usr.bin/make/meta.c
--- a/usr.bin/make/meta.c       Sun Aug 28 01:17:47 2011 +0000
+++ b/usr.bin/make/meta.c       Sun Aug 28 03:54:07 2011 +0000
@@ -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 */



Home | Main Index | Thread Index | Old Index