summaryrefslogtreecommitdiff
path: root/usr.bin/make/parse.c
diff options
context:
space:
mode:
authorrillig <rillig@NetBSD.org>2021-06-21 10:42:06 +0000
committerrillig <rillig@NetBSD.org>2021-06-21 10:42:06 +0000
commit282e80a55e10236bdb3df342a1cafca8df654f22 (patch)
treef8520883de1c7a1ec80b8c0bf3cb0eed8ece3d56 /usr.bin/make/parse.c
parent6d0c53087b63a76883b6ab221c363a5a6eee64ea (diff)
make: document ParseDependencyOp
Diffstat (limited to 'usr.bin/make/parse.c')
-rw-r--r--usr.bin/make/parse.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c
index 6f8912104d8..0cb4b933600 100644
--- a/usr.bin/make/parse.c
+++ b/usr.bin/make/parse.c
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.559 2021/06/21 10:33:11 rillig Exp $ */
+/* $NetBSD: parse.c,v 1.560 2021/06/21 10:42:06 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -109,7 +109,7 @@
#include "pathnames.h"
/* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.559 2021/06/21 10:33:11 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.560 2021/06/21 10:42:06 rillig Exp $");
/* types and constants */
@@ -1265,8 +1265,12 @@ ParseDependencyCheckSpec(ParseSpecial specType)
}
}
+/*
+ * In a dependency line like 'targets: sources' or 'targets! sources', parse
+ * the operator ':', '::' or '!' from between the targets and the sources.
+ */
static bool
-ParseDependencyParseOp(char **pp, const char *lstart, GNodeType *out_op)
+ParseDependencyOp(char **pp, const char *lstart, GNodeType *out_op)
{
const char *cp = *pp;
@@ -1694,7 +1698,7 @@ ParseDependency(char *line)
/*
* First, grind through the targets.
*/
- /* XXX: don't use line as an iterator variable */
+ /* XXX: don't use 'line' as an iterator variable */
if (!ParseDependencyTargets(&cp, &line, lstart, &specType, &tOp,
&paths, &curTargs))
goto out;
@@ -1712,7 +1716,7 @@ ParseDependency(char *line)
/*
* Have now parsed all the target names. Must parse the operator next.
*/
- if (!ParseDependencyParseOp(&cp, lstart, &op))
+ if (!ParseDependencyOp(&cp, lstart, &op))
goto out;
/*