Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/make Set .ERROR_CMD if we can
details: https://anonhg.NetBSD.org/src/rev/6a9b0d10c3c4
branches: trunk
changeset: 347030:6a9b0d10c3c4
user: sjg <sjg%NetBSD.org@localhost>
date: Wed Aug 10 23:49:12 2016 +0000
description:
Set .ERROR_CMD if we can
diffstat:
usr.bin/make/main.c | 14 +++++++++++---
usr.bin/make/make.1 | 18 +++++++++++++++---
2 files changed, 26 insertions(+), 6 deletions(-)
diffs (88 lines):
diff -r f8306a2a6b2e -r 6a9b0d10c3c4 usr.bin/make/main.c
--- a/usr.bin/make/main.c Wed Aug 10 23:49:03 2016 +0000
+++ b/usr.bin/make/main.c Wed Aug 10 23:49:12 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.248 2016/06/07 03:04:45 christos Exp $ */
+/* $NetBSD: main.c,v 1.249 2016/08/10 23:49:12 sjg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.248 2016/06/07 03:04:45 christos Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.249 2016/08/10 23:49:12 sjg 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.248 2016/06/07 03:04:45 christos Exp $");
+__RCSID("$NetBSD: main.c,v 1.249 2016/08/10 23:49:12 sjg Exp $");
#endif
#endif /* not lint */
#endif
@@ -1889,6 +1889,12 @@
}
+static int
+addErrorCMD(void *cmdp, void *gnp)
+{
+ Var_Append(".ERROR_CMD", cmdp, VAR_GLOBAL);
+ return 0;
+}
void
PrintOnError(GNode *gn, const char *s)
@@ -1909,6 +1915,8 @@
* We can print this even if there is no .ERROR target.
*/
Var_Set(".ERROR_TARGET", gn->name, VAR_GLOBAL, 0);
+ Var_Delete(".ERROR_CMD", VAR_GLOBAL);
+ Lst_ForEach(gn->commands, addErrorCMD, gn);
}
strncpy(tmp, "${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'\n@}",
sizeof(tmp) - 1);
diff -r f8306a2a6b2e -r 6a9b0d10c3c4 usr.bin/make/make.1
--- a/usr.bin/make/make.1 Wed Aug 10 23:49:03 2016 +0000
+++ b/usr.bin/make/make.1 Wed Aug 10 23:49:12 2016 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: make.1,v 1.259 2016/06/03 07:07:37 wiz Exp $
+.\" $NetBSD: make.1,v 1.260 2016/08/10 23:49:12 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 June 2, 2016
+.Dd August 10, 2016
.Dt MAKE 1
.Os
.Sh NAME
@@ -973,7 +973,19 @@
.It Va MAKE_PRINT_VAR_ON_ERROR
When
.Nm
-stops due to an error, it prints its name and the value of
+stops due to an error, it sets
+.Ql Va .ERROR_TARGET
+to the name of the target that failed,
+.Ql Va .ERROR_CMD
+to the commands of the failed target,
+and in "meta" mode, it also sets
+.Ql Va .ERROR_CWD
+to the
+.Xr getcwd 3 ,
+and
+.Ql Va .ERROR_META_FILE
+to the path of the meta file (if any) describing the failed target.
+It then prints its name and the value of
.Ql Va .CURDIR
as well as the value of any variables named in
.Ql Va MAKE_PRINT_VAR_ON_ERROR .
Home |
Main Index |
Thread Index |
Old Index