diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c index ad9d9720a7d9..4939cf37bdae 100644 --- a/usr.bin/make/compat.c +++ b/usr.bin/make/compat.c @@ -1,4 +1,4 @@ -/* $NetBSD: compat.c,v 1.51 2003/09/09 16:16:02 lukem Exp $ */ +/* $NetBSD: compat.c,v 1.52 2003/09/10 18:04:22 jmmv Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifdef MAKE_BOOTSTRAP -static char rcsid[] = "$NetBSD: compat.c,v 1.51 2003/09/09 16:16:02 lukem Exp $"; +static char rcsid[] = "$NetBSD: compat.c,v 1.52 2003/09/10 18:04:22 jmmv Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: compat.c,v 1.51 2003/09/09 16:16:02 lukem Exp $"); +__RCSID("$NetBSD: compat.c,v 1.52 2003/09/10 18:04:22 jmmv Exp $"); #endif #endif /* not lint */ #endif @@ -354,19 +354,22 @@ CompatRunCommand(ClientData cmdp, ClientData gnp) } else if (WIFEXITED(reason)) { status = WEXITSTATUS(reason); /* exited */ if (status != 0) { - printf("\n*** Failed target: %s\n*** Failed command: ", - gn->name); - for (cp = cmd; *cp; ) { - if (isspace((unsigned char)*cp)) { - putchar(' '); - while (isspace((unsigned char)*cp)) - cp++; - } else { - putchar(*cp); - cp++; - } + if (DEBUG(ERROR)) { + printf("\n*** Failed target: %s\n*** Failed command: ", + gn->name); + for (cp = cmd; *cp; ) { + if (isspace((unsigned char)*cp)) { + putchar(' '); + while (isspace((unsigned char)*cp)) + cp++; + } else { + putchar(*cp); + cp++; + } + } + printf ("\n"); } - printf ("\n*** Error code %d", status); + printf ("*** Error code %d", status); } } else { status = WTERMSIG(reason); /* signaled */ diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c index 9e76b6c0bae8..09f2e4f8e944 100644 --- a/usr.bin/make/main.c +++ b/usr.bin/make/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.92 2003/09/05 06:52:11 sjg Exp $ */ +/* $NetBSD: main.c,v 1.93 2003/09/10 18:04:22 jmmv Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifdef MAKE_BOOTSTRAP -static char rcsid[] = "$NetBSD: main.c,v 1.92 2003/09/05 06:52:11 sjg Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.93 2003/09/10 18:04:22 jmmv 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.92 2003/09/05 06:52:11 sjg Exp $"); +__RCSID("$NetBSD: main.c,v 1.93 2003/09/10 18:04:22 jmmv Exp $"); #endif #endif /* not lint */ #endif @@ -313,6 +313,9 @@ rearg: while((c = getopt(argc, argv, OPTFLAGS)) != -1) { case 'd': debug |= DEBUG_DIR; break; + case 'e': + debug |= DEBUG_ERROR; + break; case 'f': debug |= DEBUG_FOR; break; diff --git a/usr.bin/make/make.1 b/usr.bin/make/make.1 index daf4fbcac90c..b91773026685 100644 --- a/usr.bin/make/make.1 +++ b/usr.bin/make/make.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.87 2003/09/10 08:44:31 jmmv Exp $ +.\" $NetBSD: make.1,v 1.88 2003/09/10 18:04:23 jmmv Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -116,6 +116,8 @@ Print debugging information about archive searching and caching. Print debugging information about conditional evaluation. .It Ar d Print debugging information about directory searching and caching. +.It Ar e +Print debugging information about failed commands and targets. .It Ar f Print debugging information about loop evaluation. .It Ar "g1" diff --git a/usr.bin/make/make.h b/usr.bin/make/make.h index bc232f936d46..41fa73e0da4e 100644 --- a/usr.bin/make/make.h +++ b/usr.bin/make/make.h @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.47 2003/08/07 11:14:55 agc Exp $ */ +/* $NetBSD: make.h,v 1.48 2003/09/10 18:04:23 jmmv Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -412,6 +412,7 @@ extern int debug; #define DEBUG_VAR 0x0200 #define DEBUG_FOR 0x0400 #define DEBUG_SHELL 0x0800 +#define DEBUG_ERROR 0x1000 #define CONCAT(a,b) a##b