-/* $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 $ */
/*
#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 */
} 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) {
-/* $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 $ */
/*
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
-/* $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 $ */
/*
#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 */
{
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);
}