summaryrefslogtreecommitdiff
path: root/usr.bin/make/parse.c
diff options
context:
space:
mode:
authorrillig <rillig@NetBSD.org>2022-01-29 10:19:49 +0000
committerrillig <rillig@NetBSD.org>2022-01-29 10:19:49 +0000
commit40e299500d64a5279685f941a8f36f2de23ce40c (patch)
tree32e79076074d9a08585f93879c00bfec02d55d03 /usr.bin/make/parse.c
parent7b738bef50314303de5eea91336b138acfb9292e (diff)
make: for recursive variables in commands, print location
Print the approximate location based on the last command that has been defined for the target. It would be possible to get more detailed location information by counting the number of commands of the target, but that would get messy due to .USEBEFORE, .USE and .DEFAULT, and still, this is an edge case, so don't waste too much code for it now. Having this hint about the location is more helpful than just a plain "Variable X is recursive" without any further details.
Diffstat (limited to 'usr.bin/make/parse.c')
-rw-r--r--usr.bin/make/parse.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c
index b33656002f3..d1984d4fbb9 100644
--- a/usr.bin/make/parse.c
+++ b/usr.bin/make/parse.c
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.659 2022/01/29 09:38:26 rillig Exp $ */
+/* $NetBSD: parse.c,v 1.660 2022/01/29 10:19:49 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -106,7 +106,7 @@
#include "pathnames.h"
/* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.659 2022/01/29 09:38:26 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.660 2022/01/29 10:19:49 rillig Exp $");
/*
* A file being read.
@@ -435,7 +435,7 @@ FindKeyword(const char *str)
return -1;
}
-static void
+void
PrintLocation(FILE *f, bool useVars, const char *fname, size_t lineno)
{
char dirbuf[MAXPATHLEN + 1];