From 7da2fe51b3dd465ae1eaea1d43281dd450a2e570 Mon Sep 17 00:00:00 2001 From: dsl Date: Sun, 7 Dec 2003 20:30:28 +0000 Subject: [PATCH] Add a -Dg3 which outputs the 'input graph' only on error exit. Lets you see the wood for the trees... --- usr.bin/make/main.c | 12 ++++++++---- usr.bin/make/make.1 | 5 +++-- usr.bin/make/make.h | 3 ++- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c index 09f2e4f8e944..8e7c7d741603 100644 --- a/usr.bin/make/main.c +++ b/usr.bin/make/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.93 2003/09/10 18:04:22 jmmv Exp $ */ +/* $NetBSD: main.c,v 1.94 2003/12/07 20:30:28 dsl Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifdef MAKE_BOOTSTRAP -static char rcsid[] = "$NetBSD: main.c,v 1.93 2003/09/10 18:04:22 jmmv Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.94 2003/12/07 20:30:28 dsl Exp $"; #else #include #ifndef lint @@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\n\ #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: main.c,v 1.93 2003/09/10 18:04:22 jmmv Exp $"); +__RCSID("$NetBSD: main.c,v 1.94 2003/12/07 20:30:28 dsl Exp $"); #endif #endif /* not lint */ #endif @@ -328,6 +328,10 @@ rearg: while((c = getopt(argc, argv, OPTFLAGS)) != -1) { debug |= DEBUG_GRAPH2; ++modules; } + else if (modules[1] == '3') { + debug |= DEBUG_GRAPH3; + ++modules; + } break; case 'j': debug |= DEBUG_JOB; @@ -1423,7 +1427,7 @@ Fatal(const char *fmt, ...) PrintOnError(NULL); - if (DEBUG(GRAPH2)) + if (DEBUG(GRAPH2) || DEBUG(GRAPH3)) Targ_PrintGraph(2); Trace_Log(MAKEERROR, 0); exit(2); /* Not 1 so -q can distinguish error */ diff --git a/usr.bin/make/make.1 b/usr.bin/make/make.1 index 84b9e1a1a75e..82c512ff1b81 100644 --- a/usr.bin/make/make.1 +++ b/usr.bin/make/make.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.91 2003/11/07 01:01:46 lukem Exp $ +.\" $NetBSD: make.1,v 1.92 2003/12/07 20:30:28 dsl Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -124,7 +124,8 @@ Print debugging information about loop evaluation. Print the input graph before making anything. .It Ar "g2" Print the input graph after making everything, or before exiting -on error. +.It Ar "g3" +Print the input graph before exiting on error. .It Ar j Print debugging information about running multiple shells. .It Ar m diff --git a/usr.bin/make/make.h b/usr.bin/make/make.h index be71978fc40e..fdcdf6eac133 100644 --- a/usr.bin/make/make.h +++ b/usr.bin/make/make.h @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.49 2003/09/27 21:29:37 sjg Exp $ */ +/* $NetBSD: make.h,v 1.50 2003/12/07 20:30:28 dsl Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -413,6 +413,7 @@ extern int debug; #define DEBUG_FOR 0x0400 #define DEBUG_SHELL 0x0800 #define DEBUG_ERROR 0x1000 +#define DEBUG_GRAPH3 0x10000 #define CONCAT(a,b) a##b