diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2000-04-17 23:54:48 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2000-04-17 23:54:48 +0000 |
commit | 2f2fb1e760558699e8241bfeb8ad746e650bdc9a (patch) | |
tree | 7a6640292927ba2ea2fadf8556d65457bb6fafdd | |
parent | efe92132bcb7cc0b46e9a23dca584fcdf0c0ec7e (diff) |
Record location in target node as well.
Indicate what went wrong for commands like
@exit 1
-rw-r--r-- | usr.bin/make/compat.c | 12 | ||||
-rw-r--r-- | usr.bin/make/make.h | 4 | ||||
-rw-r--r-- | usr.bin/make/parse.c | 11 |
3 files changed, 20 insertions, 7 deletions
diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c index 94d78dfa9d6..a139c3cc437 100644 --- a/usr.bin/make/compat.c +++ b/usr.bin/make/compat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: compat.c,v 1.23 2000/03/26 16:21:32 espie Exp $ */ +/* $OpenBSD: compat.c,v 1.24 2000/04/17 23:54:47 espie Exp $ */ /* $NetBSD: compat.c,v 1.14 1996/11/06 17:59:01 christos Exp $ */ /* @@ -43,7 +43,7 @@ #if 0 static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94"; #else -static char rcsid[] = "$OpenBSD: compat.c,v 1.23 2000/03/26 16:21:32 espie Exp $"; +static char rcsid[] = "$OpenBSD: compat.c,v 1.24 2000/04/17 23:54:47 espie Exp $"; #endif #endif /* not lint */ @@ -604,7 +604,13 @@ CompatMake (gnp, pgnp) } else if (keepgoing) { pgn->make = FALSE; } else { - printf ("\n\nStop in %s.\n", Var_Value(".CURDIR", gn)); + if (gn->lineno) + printf("\n\nStop in %s (line %lu of %s).\n", + Var_Value(".CURDIR", gn), + (unsigned long)gn->lineno, + gn->fname); + else + printf("\n\nStop in %s.\n", Var_Value(".CURDIR", gn)); exit (1); } } else if (gn->made == ERROR) { diff --git a/usr.bin/make/make.h b/usr.bin/make/make.h index 14c76caebf0..c7e3e82d5f1 100644 --- a/usr.bin/make/make.h +++ b/usr.bin/make/make.h @@ -1,4 +1,4 @@ -/* $OpenBSD: make.h,v 1.17 2000/02/02 13:47:48 espie Exp $ */ +/* $OpenBSD: make.h,v 1.18 2000/04/17 23:54:47 espie Exp $ */ /* $NetBSD: make.h,v 1.15 1997/03/10 21:20:00 christos Exp $ */ /* @@ -161,6 +161,8 @@ typedef struct GNode { Lst preds; /* Nodes that must be made before this one */ Lst context; /* The local variables */ + unsigned long lineno; /* First line number of commands. */ + const char * fname; /* File name of commands. */ Lst commands; /* Creation commands */ struct _Suff *suffix; /* Suffix for the node (determined by diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index 309f20b43cc..8045284d392 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.c,v 1.38 2000/04/17 23:45:24 espie Exp $ */ +/* $OpenBSD: parse.c,v 1.39 2000/04/17 23:54:47 espie Exp $ */ /* $NetBSD: parse.c,v 1.29 1997/03/10 21:20:04 christos Exp $ */ /* @@ -43,7 +43,7 @@ #if 0 static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; #else -static char rcsid[] = "$OpenBSD: parse.c,v 1.38 2000/04/17 23:45:24 espie Exp $"; +static char rcsid[] = "$OpenBSD: parse.c,v 1.39 2000/04/17 23:54:47 espie Exp $"; #endif #endif /* not lint */ @@ -1592,8 +1592,13 @@ ParseAddCmd(gnp, cmd) { GNode *gn = (GNode *) gnp; /* if target already supplied, ignore commands */ - if (!(gn->type & OP_HAS_COMMANDS)) + if (!(gn->type & OP_HAS_COMMANDS)) { Lst_AtEnd(gn->commands, cmd); + if (!gn->lineno) { + gn->lineno = Parse_Getlineno(); + gn->fname = Parse_Getfilename(); + } + } return(0); } |