Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make Add new debugging option '-dn' which will leave...



details:   https://anonhg.NetBSD.org/src/rev/a46e9b7a8513
branches:  trunk
changeset: 582127:a46e9b7a8513
user:      jmc <jmc%NetBSD.org@localhost>
date:      Fri Jun 17 19:25:20 2005 +0000

description:
Add new debugging option '-dn' which will leave the scripts fed into make on
-j jobs in /tmp for debugging purposes. Add a note to the man page that
this could cause problems if run a lot (due to the number of files created)

diffstat:

 usr.bin/make/job.c  |  9 +++++----
 usr.bin/make/main.c |  9 ++++++---
 usr.bin/make/make.1 |  9 ++++++++-
 usr.bin/make/make.h |  1 +
 4 files changed, 20 insertions(+), 8 deletions(-)

diffs (107 lines):

diff -r 17f03160b9cb -r a46e9b7a8513 usr.bin/make/job.c
--- a/usr.bin/make/job.c        Fri Jun 17 18:37:24 2005 +0000
+++ b/usr.bin/make/job.c        Fri Jun 17 19:25:20 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: job.c,v 1.93 2005/06/16 18:07:45 jmc Exp $     */
+/*     $NetBSD: job.c,v 1.94 2005/06/17 19:25:20 jmc 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.93 2005/06/16 18:07:45 jmc Exp $";
+static char rcsid[] = "$NetBSD: job.c,v 1.94 2005/06/17 19:25:20 jmc 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.93 2005/06/16 18:07:45 jmc Exp $");
+__RCSID("$NetBSD: job.c,v 1.94 2005/06/17 19:25:20 jmc Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1991,7 +1991,8 @@
        (void)strcpy(tfile, TMPPAT);
        if ((tfd = mkstemp(tfile)) == -1)
            Punt("Could not create temporary file %s", strerror(errno));
-       (void) eunlink(tfile);
+       if (!DEBUG(SCRIPT))
+               (void) eunlink(tfile);
        JobSigUnlock(&mask);
 
        job->cmdFILE = fdopen(tfd, "w+");
diff -r 17f03160b9cb -r a46e9b7a8513 usr.bin/make/main.c
--- a/usr.bin/make/main.c       Fri Jun 17 18:37:24 2005 +0000
+++ b/usr.bin/make/main.c       Fri Jun 17 19:25:20 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.108 2005/06/03 16:15:46 lukem Exp $ */
+/*     $NetBSD: main.c,v 1.109 2005/06/17 19:25:20 jmc Exp $   */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.108 2005/06/03 16:15:46 lukem Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.109 2005/06/17 19:25:20 jmc Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
@@ -81,7 +81,7 @@
 #if 0
 static char sccsid[] = "@(#)main.c     8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: main.c,v 1.108 2005/06/03 16:15:46 lukem Exp $");
+__RCSID("$NetBSD: main.c,v 1.109 2005/06/17 19:25:20 jmc Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -395,6 +395,9 @@
                                case 'm':
                                        debug |= DEBUG_MAKE;
                                        break;
+                               case 'n':
+                                       debug |= DEBUG_SCRIPT;
+                                       break;
                                case 's':
                                        debug |= DEBUG_SUFF;
                                        break;
diff -r 17f03160b9cb -r a46e9b7a8513 usr.bin/make/make.1
--- a/usr.bin/make/make.1       Fri Jun 17 18:37:24 2005 +0000
+++ b/usr.bin/make/make.1       Fri Jun 17 19:25:20 2005 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: make.1,v 1.110 2005/06/15 22:39:27 rpaulo Exp $
+.\"    $NetBSD: make.1,v 1.111 2005/06/17 19:25:20 jmc Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -132,6 +132,13 @@
 .It Ar m
 Print debugging information about making targets, including modification
 dates.
+.It Ar n
+Don't delete the temporary command scripts created in /tmp when running
+commands. These are created via 
+.Xr mkstemp 3
+and have names of the form /tmp/makeXXXXX.
+.Em NOTE:
+This can create many file in /tmp so use with care.
 .It Ar s
 Print debugging information about suffix-transformation rules.
 .It Ar t
diff -r 17f03160b9cb -r a46e9b7a8513 usr.bin/make/make.h
--- a/usr.bin/make/make.h       Fri Jun 17 18:37:24 2005 +0000
+++ b/usr.bin/make/make.h       Fri Jun 17 19:25:20 2005 +0000
@@ -432,6 +432,7 @@
 #define DEBUG_SHELL    0x0800
 #define DEBUG_ERROR    0x1000
 #define        DEBUG_GRAPH3    0x10000
+#define DEBUG_SCRIPT   0x20000
 
 #define CONCAT(a,b)    a##b
 



Home | Main Index | Thread Index | Old Index