summaryrefslogtreecommitdiff
path: root/usr.bin/make/parse.c
diff options
context:
space:
mode:
authorrillig <rillig@NetBSD.org>2023-01-03 00:00:45 +0000
committerrillig <rillig@NetBSD.org>2023-01-03 00:00:45 +0000
commita716ecf18d251b593cd8eb24c7e8bd96c7b2d13e (patch)
tree678b5d79df27b7ba4fd917846684c04ea055282b /usr.bin/make/parse.c
parent0af55c8603310bd8457941c3865514075985793f (diff)
make: add more details to warning 'Extra targets ignored'
Seen in binutils/zlib/Makefile.in:1283, which defines both '.MAKE' and '.PHONY' in the same line.
Diffstat (limited to 'usr.bin/make/parse.c')
-rw-r--r--usr.bin/make/parse.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c
index 9d4d924173d..7455b7a8a83 100644
--- a/usr.bin/make/parse.c
+++ b/usr.bin/make/parse.c
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.689 2022/10/01 09:25:06 rillig Exp $ */
+/* $NetBSD: parse.c,v 1.690 2023/01/03 00:00:45 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -105,7 +105,7 @@
#include "pathnames.h"
/* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.689 2022/10/01 09:25:06 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.690 2023/01/03 00:00:45 rillig Exp $");
/*
* A file being read.
@@ -1072,8 +1072,12 @@ SkipExtraTargets(char **pp, const char *lstart)
warning = true;
p++;
}
- if (warning)
- Parse_Error(PARSE_WARNING, "Extra target ignored");
+ if (warning) {
+ const char *start = *pp;
+ cpp_skip_whitespace(&start);
+ Parse_Error(PARSE_WARNING, "Extra target '%.*s' ignored",
+ (int)(p - start), start);
+ }
*pp += p - *pp;
}