Module Name: src
Committed By: rillig
Date: Sun Dec 17 08:53:55 UTC 2023
Modified Files:
src/usr.bin/make: cond.c dir.c hash.c hash.h job.c main.c parse.c
suff.c var.c
src/usr.bin/make/unit-tests: directive-include-guard.mk
Log Message:
make: clean up names of local variables
No binary change.
To generate a diff of this commit:
cvs rdiff -u -r1.355 -r1.356 src/usr.bin/make/cond.c
cvs rdiff -u -r1.283 -r1.284 src/usr.bin/make/dir.c
cvs rdiff -u -r1.72 -r1.73 src/usr.bin/make/hash.c
cvs rdiff -u -r1.46 -r1.47 src/usr.bin/make/hash.h
cvs rdiff -u -r1.459 -r1.460 src/usr.bin/make/job.c
cvs rdiff -u -r1.603 -r1.604 src/usr.bin/make/main.c
cvs rdiff -u -r1.710 -r1.711 src/usr.bin/make/parse.c
cvs rdiff -u -r1.370 -r1.371 src/usr.bin/make/suff.c
cvs rdiff -u -r1.1082 -r1.1083 src/usr.bin/make/var.c
cvs rdiff -u -r1.13 -r1.14 \
src/usr.bin/make/unit-tests/directive-include-guard.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/cond.c
diff -u src/usr.bin/make/cond.c:1.355 src/usr.bin/make/cond.c:1.356
--- src/usr.bin/make/cond.c:1.355 Sun Nov 19 22:50:11 2023
+++ src/usr.bin/make/cond.c Sun Dec 17 08:53:54 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: cond.c,v 1.355 2023/11/19 22:50:11 rillig Exp $ */
+/* $NetBSD: cond.c,v 1.356 2023/12/17 08:53:54 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -92,7 +92,7 @@
#include "dir.h"
/* "@(#)cond.c 8.2 (Berkeley) 1/2/94" */
-MAKE_RCSID("$NetBSD: cond.c,v 1.355 2023/11/19 22:50:11 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.356 2023/12/17 08:53:54 rillig Exp $");
/*
* Conditional expressions conform to this grammar:
@@ -212,16 +212,16 @@ ParseWord(const char **pp, bool doEval)
{
const char *p = *pp;
Buffer word;
- int paren_depth;
+ int depth;
Buf_InitSize(&word, 16);
- paren_depth = 0;
+ depth = 0;
for (;;) {
char ch = *p;
if (ch == '\0' || ch == ' ' || ch == '\t')
break;
- if ((ch == '&' || ch == '|') && paren_depth == 0)
+ if ((ch == '&' || ch == '|') && depth == 0)
break;
if (ch == '$') {
VarEvalMode emode = doEval
@@ -238,8 +238,8 @@ ParseWord(const char **pp, bool doEval)
continue;
}
if (ch == '(')
- paren_depth++;
- else if (ch == ')' && --paren_depth < 0)
+ depth++;
+ else if (ch == ')' && --depth < 0)
break;
Buf_AddByte(&word, ch);
p++;
@@ -667,19 +667,19 @@ done_lhs:
static bool
CondParser_FuncCallEmpty(CondParser *par, bool doEval, Token *out_token)
{
- const char *cp = par->p;
+ const char *p = par->p;
Token tok;
FStr val;
- if (!skip_string(&cp, "empty"))
+ if (!skip_string(&p, "empty"))
return false;
- cpp_skip_whitespace(&cp);
- if (*cp != '(')
+ cpp_skip_whitespace(&p);
+ if (*p != '(')
return false;
- cp--; /* Make cp[1] point to the '('. */
- val = Var_Parse(&cp, SCOPE_CMDLINE,
+ p--; /* Make p[1] point to the '('. */
+ val = Var_Parse(&p, SCOPE_CMDLINE,
doEval ? VARE_WANTRES : VARE_PARSE_ONLY);
/* TODO: handle errors */
@@ -692,7 +692,7 @@ CondParser_FuncCallEmpty(CondParser *par
FStr_Done(&val);
*out_token = tok;
- par->p = cp;
+ par->p = p;
return true;
}
@@ -743,11 +743,11 @@ CondParser_ComparisonOrLeaf(CondParser *
{
Token t;
char *arg;
- const char *cp;
+ const char *p;
/* Push anything numeric through the compare expression */
- cp = par->p;
- if (ch_isdigit(cp[0]) || cp[0] == '-' || cp[0] == '+')
+ p = par->p;
+ if (ch_isdigit(p[0]) || p[0] == '-' || p[0] == '+')
return CondParser_Comparison(par, doEval);
/*
@@ -762,12 +762,12 @@ CondParser_ComparisonOrLeaf(CondParser *
* XXX: In edge cases, an expression may be evaluated twice,
* see cond-token-plain.mk, keyword 'twice'.
*/
- arg = ParseWord(&cp, doEval);
+ arg = ParseWord(&p, doEval);
assert(arg[0] != '\0');
- if (*cp == '=' || *cp == '!' || *cp == '<' || *cp == '>')
+ if (*p == '=' || *p == '!' || *p == '<' || *p == '>')
return CondParser_Comparison(par, doEval);
- par->p = cp;
+ par->p = p;
/*
* Evaluate the argument using the default function.
Index: src/usr.bin/make/dir.c
diff -u src/usr.bin/make/dir.c:1.283 src/usr.bin/make/dir.c:1.284
--- src/usr.bin/make/dir.c:1.283 Thu Sep 21 20:30:59 2023
+++ src/usr.bin/make/dir.c Sun Dec 17 08:53:54 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: dir.c,v 1.283 2023/09/21 20:30:59 rillig Exp $ */
+/* $NetBSD: dir.c,v 1.284 2023/12/17 08:53:54 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -132,7 +132,7 @@
#include "job.h"
/* "@(#)dir.c 8.2 (Berkeley) 1/2/94" */
-MAKE_RCSID("$NetBSD: dir.c,v 1.283 2023/09/21 20:30:59 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.284 2023/12/17 08:53:54 rillig Exp $");
/*
* A search path is a list of CachedDir structures. A CachedDir has in it the
@@ -683,14 +683,14 @@ DirMatchFiles(const char *pattern, Cache
static const char *
closing_brace(const char *p)
{
- int nest = 0;
+ int depth = 0;
while (*p != '\0') {
- if (*p == '}' && nest == 0)
+ if (*p == '}' && depth == 0)
break;
if (*p == '{')
- nest++;
+ depth++;
if (*p == '}')
- nest--;
+ depth--;
p++;
}
return p;
@@ -703,14 +703,14 @@ closing_brace(const char *p)
static const char *
separator_comma(const char *p)
{
- int nest = 0;
+ int depth = 0;
while (*p != '\0') {
- if ((*p == '}' || *p == ',') && nest == 0)
+ if ((*p == '}' || *p == ',') && depth == 0)
break;
if (*p == '{')
- nest++;
+ depth++;
if (*p == '}')
- nest--;
+ depth--;
p++;
}
return p;
Index: src/usr.bin/make/hash.c
diff -u src/usr.bin/make/hash.c:1.72 src/usr.bin/make/hash.c:1.73
--- src/usr.bin/make/hash.c:1.72 Wed Feb 9 21:09:24 2022
+++ src/usr.bin/make/hash.c Sun Dec 17 08:53:55 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: hash.c,v 1.72 2022/02/09 21:09:24 rillig Exp $ */
+/* $NetBSD: hash.c,v 1.73 2023/12/17 08:53:55 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -74,7 +74,7 @@
#include "make.h"
/* "@(#)hash.c 8.1 (Berkeley) 6/6/93" */
-MAKE_RCSID("$NetBSD: hash.c,v 1.72 2022/02/09 21:09:24 rillig Exp $");
+MAKE_RCSID("$NetBSD: hash.c,v 1.73 2023/12/17 08:53:55 rillig Exp $");
/*
* The ratio of # entries to # buckets at which we rebuild the table to
@@ -113,7 +113,7 @@ Hash_Substring(Substring key)
static HashEntry *
HashTable_Find(HashTable *t, Substring key, unsigned int h)
{
- HashEntry *e;
+ HashEntry *he;
unsigned int chainlen = 0;
size_t keyLen = Substring_Length(key);
@@ -122,18 +122,18 @@ HashTable_Find(HashTable *t, Substring k
t, h, (int)keyLen, key.start);
#endif
- for (e = t->buckets[h & t->bucketsMask]; e != NULL; e = e->next) {
+ for (he = t->buckets[h & t->bucketsMask]; he != NULL; he = he->next) {
chainlen++;
- if (e->key_hash == h &&
- strncmp(e->key, key.start, keyLen) == 0 &&
- e->key[keyLen] == '\0')
+ if (he->hash == h &&
+ strncmp(he->key, key.start, keyLen) == 0 &&
+ he->key[keyLen] == '\0')
break;
}
if (chainlen > t->maxchain)
t->maxchain = chainlen;
- return e;
+ return he;
}
/* Set up the hash table. */
@@ -226,8 +226,8 @@ HashTable_Enlarge(HashTable *t)
HashEntry *he = oldBuckets[i];
while (he != NULL) {
HashEntry *next = he->next;
- he->next = newBuckets[he->key_hash & newMask];
- newBuckets[he->key_hash & newMask] = he;
+ he->next = newBuckets[he->hash & newMask];
+ newBuckets[he->hash & newMask] = he;
he = next;
}
}
@@ -264,7 +264,7 @@ HashTable_CreateEntry(HashTable *t, cons
he = bmake_malloc(sizeof *he + (size_t)(keyEnd - key));
he->value = NULL;
- he->key_hash = h;
+ he->hash = h;
memcpy(he->key, key, (size_t)(keyEnd - key) + 1);
he->next = t->buckets[h & t->bucketsMask];
@@ -287,7 +287,7 @@ HashTable_Set(HashTable *t, const char *
void
HashTable_DeleteEntry(HashTable *t, HashEntry *he)
{
- HashEntry **ref = &t->buckets[he->key_hash & t->bucketsMask];
+ HashEntry **ref = &t->buckets[he->hash & t->bucketsMask];
HashEntry *p;
for (; (p = *ref) != NULL; ref = &p->next) {
Index: src/usr.bin/make/hash.h
diff -u src/usr.bin/make/hash.h:1.46 src/usr.bin/make/hash.h:1.47
--- src/usr.bin/make/hash.h:1.46 Mon Jan 31 22:58:26 2022
+++ src/usr.bin/make/hash.h Sun Dec 17 08:53:55 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: hash.h,v 1.46 2022/01/31 22:58:26 rillig Exp $ */
+/* $NetBSD: hash.h,v 1.47 2023/12/17 08:53:55 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -82,7 +82,7 @@ typedef struct HashEntry {
struct HashEntry *next; /* Used to link together all the entries
* associated with the same bucket. */
void *value;
- unsigned int key_hash; /* hash value of the key */
+ unsigned int hash; /* hash value of the key */
char key[1]; /* key string, variable length */
} HashEntry;
@@ -109,15 +109,15 @@ typedef struct HashSet {
} HashSet;
MAKE_INLINE void * MAKE_ATTR_USE
-HashEntry_Get(HashEntry *h)
+HashEntry_Get(HashEntry *he)
{
- return h->value;
+ return he->value;
}
MAKE_INLINE void
-HashEntry_Set(HashEntry *h, void *datum)
+HashEntry_Set(HashEntry *he, void *datum)
{
- h->value = datum;
+ he->value = datum;
}
/* Set things up for iterating over all entries in the hash table. */
Index: src/usr.bin/make/job.c
diff -u src/usr.bin/make/job.c:1.459 src/usr.bin/make/job.c:1.460
--- src/usr.bin/make/job.c:1.459 Wed Feb 15 06:52:58 2023
+++ src/usr.bin/make/job.c Sun Dec 17 08:53:55 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: job.c,v 1.459 2023/02/15 06:52:58 rillig Exp $ */
+/* $NetBSD: job.c,v 1.460 2023/12/17 08:53:55 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -142,7 +142,7 @@
#include "trace.h"
/* "@(#)job.c 8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: job.c,v 1.459 2023/02/15 06:52:58 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.460 2023/12/17 08:53:55 rillig Exp $");
/*
* A shell defines how the commands are run. All commands for a target are
@@ -1766,12 +1766,12 @@ JobStart(GNode *gn, bool special)
* itself.
*/
static char *
-PrintFilteredOutput(char *cp, char *endp) /* XXX: should all be const */
+PrintFilteredOutput(char *p, char *endp) /* XXX: should all be const */
{
- char *ecp; /* XXX: should be const */
+ char *ep; /* XXX: should be const */
if (shell->noPrint == NULL || shell->noPrint[0] == '\0')
- return cp;
+ return p;
/*
* XXX: What happens if shell->noPrint occurs on the boundary of
@@ -1779,9 +1779,9 @@ PrintFilteredOutput(char *cp, char *endp
* be a proper stream filter instead of doing string matching on
* selected chunks of the output.
*/
- while ((ecp = strstr(cp, shell->noPrint)) != NULL) {
- if (ecp != cp) {
- *ecp = '\0'; /* XXX: avoid writing to the buffer */
+ while ((ep = strstr(p, shell->noPrint)) != NULL) {
+ if (ep != p) {
+ *ep = '\0'; /* XXX: avoid writing to the buffer */
/*
* The only way there wouldn't be a newline after
* this line is if it were the last in the buffer.
@@ -1789,16 +1789,16 @@ PrintFilteredOutput(char *cp, char *endp
* there must be a newline, so we don't print one.
*/
/* XXX: What about null bytes in the output? */
- (void)fprintf(stdout, "%s", cp);
+ (void)fprintf(stdout, "%s", p);
(void)fflush(stdout);
}
- cp = ecp + shell->noPrintLen;
- if (cp == endp)
+ p = ep + shell->noPrintLen;
+ if (p == endp)
break;
- cp++; /* skip over the (XXX: assumed) newline */
- pp_skip_whitespace(&cp);
+ p++; /* skip over the (XXX: assumed) newline */
+ pp_skip_whitespace(&p);
}
- return cp;
+ return p;
}
/*
@@ -1893,7 +1893,7 @@ again:
*/
job->outBuf[i] = '\0';
if (i >= job->curPos) {
- char *cp;
+ char *p;
/*
* FIXME: SwitchOutputTo should be here, according to
@@ -1901,23 +1901,23 @@ again:
* do anything in the default shell, this bug has gone
* unnoticed until now.
*/
- cp = PrintFilteredOutput(job->outBuf, &job->outBuf[i]);
+ p = PrintFilteredOutput(job->outBuf, &job->outBuf[i]);
/*
* There's still more in the output buffer. This time,
* though, we know there's no newline at the end, so
* we add one of our own free will.
*/
- if (*cp != '\0') {
+ if (*p != '\0') {
if (!opts.silent)
SwitchOutputTo(job->node);
#ifdef USE_META
if (useMeta) {
- meta_job_output(job, cp,
+ meta_job_output(job, p,
gotNL ? "\n" : "");
}
#endif
- (void)fprintf(stdout, "%s%s", cp,
+ (void)fprintf(stdout, "%s%s", p,
gotNL ? "\n" : "");
(void)fflush(stdout);
}
Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.603 src/usr.bin/make/main.c:1.604
--- src/usr.bin/make/main.c:1.603 Thu Nov 2 05:55:22 2023
+++ src/usr.bin/make/main.c Sun Dec 17 08:53:55 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.603 2023/11/02 05:55:22 rillig Exp $ */
+/* $NetBSD: main.c,v 1.604 2023/12/17 08:53:55 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -111,7 +111,7 @@
#include "trace.h"
/* "@(#)main.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: main.c,v 1.603 2023/11/02 05:55:22 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.604 2023/12/17 08:53:55 rillig Exp $");
#if defined(MAKE_NATIVE)
__COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
"The Regents of the University of California. "
@@ -778,13 +778,13 @@ SetVarObjdir(bool writable, const char *
int
str2Lst_Append(StringList *lp, char *str)
{
- char *cp;
+ char *p;
int n;
const char *sep = " \t";
- for (n = 0, cp = strtok(str, sep); cp != NULL; cp = strtok(NULL, sep)) {
- Lst_Append(lp, cp);
+ for (n = 0, p = strtok(str, sep); p != NULL; p = strtok(NULL, sep)) {
+ Lst_Append(lp, p);
n++;
}
return n;
@@ -1150,7 +1150,7 @@ static void
InitDefSysIncPath(char *syspath)
{
static char defsyspath[] = _PATH_DEFSYSPATH;
- char *start, *cp;
+ char *start, *p;
/*
* If no user-supplied system path was given (through the -m option)
@@ -1162,11 +1162,11 @@ InitDefSysIncPath(char *syspath)
else
syspath = bmake_strdup(syspath);
- for (start = syspath; *start != '\0'; start = cp) {
- for (cp = start; *cp != '\0' && *cp != ':'; cp++)
+ for (start = syspath; *start != '\0'; start = p) {
+ for (p = start; *p != '\0' && *p != ':'; p++)
continue;
- if (*cp == ':')
- *cp++ = '\0';
+ if (*p == ':')
+ *p++ = '\0';
/* look for magic parent directory search string */
if (strncmp(start, ".../", 4) == 0) {
@@ -1257,17 +1257,17 @@ InitVpath(void)
/* TODO: handle errors */
path = vpath;
do {
- char *cp;
+ char *p;
/* skip to end of directory */
- for (cp = path; *cp != ':' && *cp != '\0'; cp++)
+ for (p = path; *p != ':' && *p != '\0'; p++)
continue;
/* Save terminator character so know when to stop */
- savec = *cp;
- *cp = '\0';
+ savec = *p;
+ *p = '\0';
/* Add directory to search path */
(void)SearchPath_Add(&dirSearchPath, path);
- *cp = savec;
- path = cp + 1;
+ *p = savec;
+ path = p + 1;
} while (savec == ':');
free(vpath);
}
@@ -1708,7 +1708,7 @@ Cmd_Exec(const char *cmd, char **error)
Buffer buf; /* buffer to store the result */
ssize_t bytes_read;
char *output;
- char *cp;
+ char *p;
int saved_errno;
if (shellName == NULL)
@@ -1766,9 +1766,9 @@ Cmd_Exec(const char *cmd, char **error)
buf.data[buf.len - 1] = '\0';
output = Buf_DoneData(&buf);
- for (cp = output; *cp != '\0'; cp++)
- if (*cp == '\n')
- *cp = ' ';
+ for (p = output; *p != '\0'; p++)
+ if (*p == '\n')
+ *p = ' ';
if (WIFSIGNALED(status))
*error = str_concat3("\"", cmd, "\" exited on a signal");
@@ -1954,13 +1954,13 @@ execDie(const char *af, const char *av)
static void
purge_relative_cached_realpaths(void)
{
- HashEntry *he, *nhe;
+ HashEntry *he, *next;
HashIter hi;
HashIter_Init(&hi, &cached_realpaths);
he = HashIter_Next(&hi);
while (he != NULL) {
- nhe = HashIter_Next(&hi);
+ next = HashIter_Next(&hi);
if (he->key[0] != '/') {
DEBUG1(DIR, "cached_realpath: purging %s\n", he->key);
HashTable_DeleteEntry(&cached_realpaths, he);
@@ -1969,7 +1969,7 @@ purge_relative_cached_realpaths(void)
* free them or document why they cannot be freed.
*/
}
- he = nhe;
+ he = next;
}
}
Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.710 src/usr.bin/make/parse.c:1.711
--- src/usr.bin/make/parse.c:1.710 Sun Nov 19 22:50:11 2023
+++ src/usr.bin/make/parse.c Sun Dec 17 08:53:55 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.710 2023/11/19 22:50:11 rillig Exp $ */
+/* $NetBSD: parse.c,v 1.711 2023/12/17 08:53:55 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.710 2023/11/19 22:50:11 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.711 2023/12/17 08:53:55 rillig Exp $");
/* Detects a multiple-inclusion guard in a makefile. */
typedef enum {
@@ -2217,7 +2217,7 @@ IsSysVInclude(const char *line)
static void
ParseTraditionalInclude(char *line)
{
- char *cp; /* current position in file spec */
+ char *p; /* current position in file spec */
bool done = false;
bool silent = line[0] != 'i';
char *file = line + (silent ? 8 : 7);
@@ -2230,13 +2230,13 @@ ParseTraditionalInclude(char *line)
all_files = Var_Subst(file, SCOPE_CMDLINE, VARE_WANTRES);
/* TODO: handle errors */
- for (file = all_files; !done; file = cp + 1) {
+ for (file = all_files; !done; file = p + 1) {
/* Skip to end of line or next whitespace */
- for (cp = file; *cp != '\0' && !ch_isspace(*cp); cp++)
+ for (p = file; *p != '\0' && !ch_isspace(*p); p++)
continue;
- if (*cp != '\0')
- *cp = '\0';
+ if (*p != '\0')
+ *p = '\0';
else
done = true;
@@ -2721,26 +2721,26 @@ HandleBreak(const char *arg)
static bool
ParseDirective(char *line)
{
- char *cp = line + 1;
+ char *p = line + 1;
const char *arg;
Substring dir;
- pp_skip_whitespace(&cp);
- if (IsInclude(cp, false)) {
- ParseInclude(cp);
+ pp_skip_whitespace(&p);
+ if (IsInclude(p, false)) {
+ ParseInclude(p);
return true;
}
- dir.start = cp;
- while (ch_islower(*cp) || *cp == '-')
- cp++;
- dir.end = cp;
+ dir.start = p;
+ while (ch_islower(*p) || *p == '-')
+ p++;
+ dir.end = p;
- if (*cp != '\0' && !ch_isspace(*cp))
+ if (*p != '\0' && !ch_isspace(*p))
return false;
- pp_skip_whitespace(&cp);
- arg = cp;
+ pp_skip_whitespace(&p);
+ arg = p;
if (Substring_Equals(dir, "break"))
HandleBreak(arg);
@@ -2801,7 +2801,7 @@ Parse_GuardEndif(void)
static char *
FindSemicolon(char *p)
{
- int level = 0;
+ int depth = 0;
for (; *p != '\0'; p++) {
if (*p == '\\' && p[1] != '\0') {
@@ -2810,10 +2810,10 @@ FindSemicolon(char *p)
}
if (*p == '$' && (p[1] == '(' || p[1] == '{'))
- level++;
- else if (level > 0 && (*p == ')' || *p == '}'))
- level--;
- else if (level == 0 && *p == ';')
+ depth++;
+ else if (depth > 0 && (*p == ')' || *p == '}'))
+ depth--;
+ else if (depth == 0 && *p == ';')
break;
}
return p;
Index: src/usr.bin/make/suff.c
diff -u src/usr.bin/make/suff.c:1.370 src/usr.bin/make/suff.c:1.371
--- src/usr.bin/make/suff.c:1.370 Sun Nov 19 22:50:11 2023
+++ src/usr.bin/make/suff.c Sun Dec 17 08:53:55 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: suff.c,v 1.370 2023/11/19 22:50:11 rillig Exp $ */
+/* $NetBSD: suff.c,v 1.371 2023/12/17 08:53:55 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -115,7 +115,7 @@
#include "dir.h"
/* "@(#)suff.c 8.4 (Berkeley) 3/21/94" */
-MAKE_RCSID("$NetBSD: suff.c,v 1.370 2023/11/19 22:50:11 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.371 2023/12/17 08:53:55 rillig Exp $");
typedef List SuffixList;
typedef ListNode SuffixListNode;
@@ -1258,10 +1258,10 @@ ExpandWildcards(GNodeListNode *cln, GNod
/*
* Fetch next expansion off the list and find its GNode
*/
- char *cp = Lst_Dequeue(&expansions);
+ char *name = Lst_Dequeue(&expansions);
- DEBUG1(SUFF, "%s...", cp);
- gn = Targ_GetNode(cp);
+ DEBUG1(SUFF, "%s...", name);
+ gn = Targ_GetNode(name);
/* Insert gn before the original child. */
Lst_InsertBefore(&pgn->children, cln, gn);
@@ -1290,54 +1290,54 @@ ExpandWildcards(GNodeListNode *cln, GNod
* expressions with spaces in them.
*/
static void
-ExpandChildrenRegular(char *cp, GNode *pgn, GNodeList *members)
+ExpandChildrenRegular(char *p, GNode *pgn, GNodeList *members)
{
char *start;
- pp_skip_hspace(&cp);
- start = cp;
- while (*cp != '\0') {
- if (*cp == ' ' || *cp == '\t') {
+ pp_skip_hspace(&p);
+ start = p;
+ while (*p != '\0') {
+ if (*p == ' ' || *p == '\t') {
GNode *gn;
/*
* White-space -- terminate element, find the node,
* add it, skip any further spaces.
*/
- *cp++ = '\0';
+ *p++ = '\0';
gn = Targ_GetNode(start);
Lst_Append(members, gn);
- pp_skip_hspace(&cp);
+ pp_skip_hspace(&p);
/* Continue at the next non-space. */
- start = cp;
- } else if (*cp == '$') {
+ start = p;
+ } else if (*p == '$') {
/* Skip over the expression. */
- const char *nested_p = cp;
+ const char *nested_p = p;
FStr junk = Var_Parse(&nested_p, pgn, VARE_PARSE_ONLY);
/* TODO: handle errors */
if (junk.str == var_Error) {
Parse_Error(PARSE_FATAL,
"Malformed expression at \"%s\"",
- cp);
- cp++;
+ p);
+ p++;
} else {
- cp += nested_p - cp;
+ p += nested_p - p;
}
FStr_Done(&junk);
- } else if (cp[0] == '\\' && cp[1] != '\0') {
+ } else if (p[0] == '\\' && p[1] != '\0') {
/* Escaped something -- skip over it. */
/*
* XXX: In other places, escaping at this syntactical
* position is done by a '$', not a '\'. The '\' is
* only used in variable modifiers.
*/
- cp += 2;
+ p += 2;
} else {
- cp++;
+ p++;
}
}
- if (cp != start) {
+ if (p != start) {
/*
* Stuff left over -- add it to the list too
*/
@@ -1361,7 +1361,7 @@ static void
ExpandChildren(GNodeListNode *cln, GNode *pgn)
{
GNode *cgn = cln->datum;
- char *cp; /* Expanded value */
+ char *expanded;
if (!Lst_IsEmpty(&cgn->order_pred) || !Lst_IsEmpty(&cgn->order_succ))
/* It is all too hard to process the result of .ORDER */
@@ -1383,7 +1383,7 @@ ExpandChildren(GNodeListNode *cln, GNode
}
DEBUG1(SUFF, "Expanding \"%s\"...", cgn->name);
- cp = Var_Subst(cgn->name, pgn, VARE_UNDEFERR);
+ expanded = Var_Subst(cgn->name, pgn, VARE_UNDEFERR);
/* TODO: handle errors */
{
@@ -1395,10 +1395,10 @@ ExpandChildren(GNodeListNode *cln, GNode
* call on the Arch module to find the nodes for us,
* expanding variables in the parent's scope.
*/
- char *p = cp;
- (void)Arch_ParseArchive(&p, &members, pgn);
+ char *ap = expanded;
+ (void)Arch_ParseArchive(&ap, &members, pgn);
} else {
- ExpandChildrenRegular(cp, pgn, &members);
+ ExpandChildrenRegular(expanded, pgn, &members);
}
/*
@@ -1420,7 +1420,7 @@ ExpandChildren(GNodeListNode *cln, GNode
}
Lst_Done(&members);
- free(cp);
+ free(expanded);
}
DEBUG0(SUFF, "\n");
Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.1082 src/usr.bin/make/var.c:1.1083
--- src/usr.bin/make/var.c:1.1082 Sun Dec 10 20:17:23 2023
+++ src/usr.bin/make/var.c Sun Dec 17 08:53:55 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: var.c,v 1.1082 2023/12/10 20:17:23 rillig Exp $ */
+/* $NetBSD: var.c,v 1.1083 2023/12/17 08:53:55 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -139,7 +139,7 @@
#include "metachar.h"
/* "@(#)var.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.1082 2023/12/10 20:17:23 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.1083 2023/12/17 08:53:55 rillig Exp $");
/*
* Variables are defined using one of the VAR=value assignments. Their
@@ -789,10 +789,10 @@ Var_ExportVars(const char *varnames)
static void
ClearEnv(void)
{
- const char *cp;
+ const char *level;
char **newenv;
- cp = getenv(MAKE_LEVEL_ENV); /* we should preserve this */
+ level = getenv(MAKE_LEVEL_ENV); /* we should preserve this */
if (environ == savedEnv) {
/* we have been here before! */
newenv = bmake_realloc(environ, 2 * sizeof(char *));
@@ -808,8 +808,8 @@ ClearEnv(void)
environ = savedEnv = newenv;
newenv[0] = NULL;
newenv[1] = NULL;
- if (cp != NULL && *cp != '\0')
- setenv(MAKE_LEVEL_ENV, cp, 1);
+ if (level != NULL && *level != '\0')
+ setenv(MAKE_LEVEL_ENV, level, 1);
}
static void
@@ -865,12 +865,12 @@ UnexportVar(Substring varname, UnexportW
if (what == UNEXPORT_NAMED) {
/* Remove the variable names from .MAKE.EXPORTED. */
/* XXX: v->name is injected without escaping it */
- char *expr = str_concat3("${.MAKE.EXPORTED:N",
- v->name.str, "}");
- char *cp = Var_Subst(expr, SCOPE_GLOBAL, VARE_WANTRES);
+ char *expr = str_concat3(
+ "${.MAKE.EXPORTED:N", v->name.str, "}");
+ char *filtered = Var_Subst(expr, SCOPE_GLOBAL, VARE_WANTRES);
/* TODO: handle errors */
- Global_Set(".MAKE.EXPORTED", cp);
- free(cp);
+ Global_Set(".MAKE.EXPORTED", filtered);
+ free(filtered);
free(expr);
}
}
@@ -2722,9 +2722,9 @@ ParseModifier_Match(const char **pp, con
* See if the code can be merged.
* See also ApplyModifier_Defined.
*/
- int nest = 0;
+ int depth = 0;
const char *p;
- for (p = mod + 1; *p != '\0' && !(*p == ':' && nest == 0); p++) {
+ for (p = mod + 1; *p != '\0' && !(*p == ':' && depth == 0); p++) {
if (*p == '\\' && p[1] != '\0' &&
(IsDelimiter(p[1], ch) || p[1] == ch->startc)) {
if (!needSubst)
@@ -2735,10 +2735,10 @@ ParseModifier_Match(const char **pp, con
if (*p == '$')
needSubst = true;
if (*p == '(' || *p == '{')
- nest++;
+ depth++;
if (*p == ')' || *p == '}') {
- nest--;
- if (nest < 0)
+ depth--;
+ if (depth < 0)
break;
}
}
Index: src/usr.bin/make/unit-tests/directive-include-guard.mk
diff -u src/usr.bin/make/unit-tests/directive-include-guard.mk:1.13 src/usr.bin/make/unit-tests/directive-include-guard.mk:1.14
--- src/usr.bin/make/unit-tests/directive-include-guard.mk:1.13 Thu Oct 19 18:24:33 2023
+++ src/usr.bin/make/unit-tests/directive-include-guard.mk Sun Dec 17 08:53:55 2023
@@ -1,4 +1,4 @@
-# $NetBSD: directive-include-guard.mk,v 1.13 2023/10/19 18:24:33 rillig Exp $
+# $NetBSD: directive-include-guard.mk,v 1.14 2023/12/17 08:53:55 rillig Exp $
#
# Tests for multiple-inclusion guards in makefiles.
#
@@ -28,7 +28,7 @@
# This is the canonical form of a variable-based multiple-inclusion guard.
-INCS+= variable-ifndef
+CASES+= variable-ifndef
LINES.variable-ifndef= \
'.ifndef VARIABLE_IFNDEF' \
'VARIABLE_IFNDEF=' \
@@ -39,7 +39,7 @@ LINES.variable-ifndef= \
# A file that reuses a guard from a previous file (or whose guard is defined
# for any other reason) is only processed once, to see whether it is guarded.
# Its content is skipped, therefore the syntax error is not detected.
-INCS+= variable-ifndef-reuse
+CASES+= variable-ifndef-reuse
LINES.variable-ifndef-reuse= \
'.ifndef VARIABLE_IFNDEF' \
'syntax error' \
@@ -49,7 +49,7 @@ LINES.variable-ifndef-reuse= \
# The guard variable cannot be a number, as numbers are interpreted
# differently from bare words.
-INCS+= variable-ifndef-zero
+CASES+= variable-ifndef-zero
LINES.variable-ifndef-zero= \
'.ifndef 0e0' \
'syntax error' \
@@ -59,7 +59,7 @@ LINES.variable-ifndef-zero= \
# The guard variable cannot be a number, as numbers are interpreted
# differently from bare words.
-INCS+= variable-ifndef-one
+CASES+= variable-ifndef-one
LINES.variable-ifndef-one= \
'.ifndef 1' \
'.endif'
@@ -67,7 +67,7 @@ LINES.variable-ifndef-one= \
# expect: Parse_PushInput: file variable-ifndef-one.tmp, line 1
# Comments and empty lines do not affect the multiple-inclusion guard.
-INCS+= comments
+CASES+= comments
LINES.comments= \
'\# comment' \
'' \
@@ -82,7 +82,7 @@ LINES.comments= \
# An alternative form uses the 'defined' function. It is more verbose than
# the canonical form but avoids the '.ifndef' directive, as that directive is
# not commonly used.
-INCS+= variable-if
+CASES+= variable-if
LINES.variable-if= \
'.if !defined(VARIABLE_IF)' \
'VARIABLE_IF=' \
@@ -93,7 +93,7 @@ LINES.variable-if= \
# A file that reuses a guard from a previous file (or whose guard is defined
# for any other reason) is only processed once, to see whether it is guarded.
# Its content is skipped, therefore the syntax error is not detected.
-INCS+= variable-if-reuse
+CASES+= variable-if-reuse
LINES.variable-if-reuse= \
'.if !defined(VARIABLE_IF)' \
'syntax error' \
@@ -103,7 +103,7 @@ LINES.variable-if-reuse= \
# Triple negation is so uncommon that it's not recognized, even though it has
# the same effect as a single negation.
-INCS+= variable-if-triple-negation
+CASES+= variable-if-triple-negation
LINES.variable-if-triple-negation= \
'.if !!!defined(VARIABLE_IF_TRIPLE_NEGATION)' \
'VARIABLE_IF_TRIPLE_NEGATION=' \
@@ -113,7 +113,7 @@ LINES.variable-if-triple-negation= \
# A conditional other than '.if' or '.ifndef' does not guard the file, even if
# it is otherwise equivalent to the above accepted forms.
-INCS+= variable-ifdef-negated
+CASES+= variable-ifdef-negated
LINES.variable-ifdef-negated= \
'.ifdef !VARIABLE_IFDEF_NEGATED' \
'VARIABLE_IFDEF_NEGATED=' \
@@ -122,7 +122,7 @@ LINES.variable-ifdef-negated= \
# expect: Parse_PushInput: file variable-ifdef-negated.tmp, line 1
# The variable names in the '.if' and the assignment must be the same.
-INCS+= variable-name-mismatch
+CASES+= variable-name-mismatch
LINES.variable-name-mismatch= \
'.ifndef VARIABLE_NAME_MISMATCH' \
'VARIABLE_NAME_DIFFERENT=' \
@@ -136,7 +136,7 @@ LINES.variable-name-mismatch= \
# accept '!' in the guard variable name. Furthermore, when defining the
# variable, the character '!' has to be escaped, to prevent it from being
# interpreted as the '!' dependency operator.
-INCS+= variable-name-exclamation
+CASES+= variable-name-exclamation
LINES.variable-name-exclamation= \
'.if !defined(!VARIABLE_NAME_EXCLAMATION)' \
'${:U!}VARIABLE_NAME_EXCLAMATION=' \
@@ -148,7 +148,7 @@ LINES.variable-name-exclamation= \
# character is interpreted as an ordinary character in conditions as well as
# on the left side of a variable assignment. For guard variable names, the
# '!' is not supported in any place, though.
-INCS+= variable-name-exclamation-middle
+CASES+= variable-name-exclamation-middle
LINES.variable-name-exclamation-middle= \
'.ifndef VARIABLE_NAME!MIDDLE' \
'VARIABLE_NAME!MIDDLE=' \
@@ -161,7 +161,7 @@ LINES.variable-name-exclamation-middle=
# where parentheses or braces are handled inconsistently to make this naming
# choice a bad idea, therefore these characters are not allowed in guard
# variable names.
-INCS+= variable-name-parentheses
+CASES+= variable-name-parentheses
LINES.variable-name-parentheses= \
'.ifndef VARIABLE_NAME(&)PARENTHESES' \
'VARIABLE_NAME(&)PARENTHESES=' \
@@ -170,7 +170,7 @@ LINES.variable-name-parentheses= \
# expect: Parse_PushInput: file variable-name-parentheses.tmp, line 1
# The guard condition must consist of only the guard variable, nothing else.
-INCS+= variable-ifndef-plus
+CASES+= variable-ifndef-plus
LINES.variable-ifndef-plus= \
'.ifndef VARIABLE_IFNDEF_PLUS && VARIABLE_IFNDEF_SECOND' \
'VARIABLE_IFNDEF_PLUS=' \
@@ -180,7 +180,7 @@ LINES.variable-ifndef-plus= \
# expect: Parse_PushInput: file variable-ifndef-plus.tmp, line 1
# The guard condition must consist of only the guard variable, nothing else.
-INCS+= variable-if-plus
+CASES+= variable-if-plus
LINES.variable-if-plus= \
'.if !defined(VARIABLE_IF_PLUS) && !defined(VARIABLE_IF_SECOND)' \
'VARIABLE_IF_PLUS=' \
@@ -191,7 +191,7 @@ LINES.variable-if-plus= \
# The variable name in an '.ifndef' guard must be given directly, it must not
# contain any '$' expression.
-INCS+= variable-ifndef-indirect
+CASES+= variable-ifndef-indirect
LINES.variable-ifndef-indirect= \
'.ifndef $${VARIABLE_IFNDEF_INDIRECT:L}' \
'VARIABLE_IFNDEF_INDIRECT=' \
@@ -201,7 +201,7 @@ LINES.variable-ifndef-indirect= \
# The variable name in an '.if' guard must be given directly, it must not
# contain any '$' expression.
-INCS+= variable-if-indirect
+CASES+= variable-if-indirect
LINES.variable-if-indirect= \
'.if !defined($${VARIABLE_IF_INDIRECT:L})' \
'VARIABLE_IF_INDIRECT=' \
@@ -213,7 +213,7 @@ LINES.variable-if-indirect= \
# characters and underscores. The place where the guard variable is defined
# is more flexible, as long as the variable is defined at the point where the
# file is included the next time.
-INCS+= variable-assign-indirect
+CASES+= variable-assign-indirect
LINES.variable-assign-indirect= \
'.ifndef VARIABLE_ASSIGN_INDIRECT' \
'$${VARIABLE_ASSIGN_INDIRECT:L}=' \
@@ -223,7 +223,7 @@ LINES.variable-assign-indirect= \
# The time at which the guard variable is defined doesn't matter, as long as
# it is defined at the point where the file is included the next time.
-INCS+= variable-assign-late
+CASES+= variable-assign-late
LINES.variable-assign-late= \
'.ifndef VARIABLE_ASSIGN_LATE' \
'VARIABLE_ASSIGN_LATE_OTHER=' \
@@ -234,7 +234,7 @@ LINES.variable-assign-late= \
# The time at which the guard variable is defined doesn't matter, as long as
# it is defined at the point where the file is included the next time.
-INCS+= variable-assign-nested
+CASES+= variable-assign-nested
LINES.variable-assign-nested= \
'.ifndef VARIABLE_ASSIGN_NESTED' \
'. if 1' \
@@ -251,7 +251,7 @@ LINES.variable-assign-nested= \
# skips almost all lines, as they are irrelevant, but the structure of the
# top-level '.if/.endif' conditional can be determined reliably enough to
# decide whether the file is guarded.
-INCS+= variable-already-defined
+CASES+= variable-already-defined
LINES.variable-already-defined= \
'.ifndef VARIABLE_ALREADY_DEFINED' \
'VARIABLE_ALREADY_DEFINED=' \
@@ -264,7 +264,7 @@ VARIABLE_ALREADY_DEFINED=
# the file is processed but its content is skipped. If that same guard
# variable is undefined when the file is included the second time, the file is
# processed as usual.
-INCS+= variable-defined-then-undefined
+CASES+= variable-defined-then-undefined
LINES.variable-defined-then-undefined= \
'.ifndef VARIABLE_DEFINED_THEN_UNDEFINED' \
'.endif'
@@ -278,7 +278,7 @@ UNDEF_BETWEEN.variable-defined-then-unde
# several, as each of these conditionals would require its separate guard.
# This case is not expected to occur in practice, as the two parts would
# rather be split into separate files.
-INCS+= variable-two-times
+CASES+= variable-two-times
LINES.variable-two-times= \
'.ifndef VARIABLE_TWO_TIMES_1' \
'VARIABLE_TWO_TIMES_1=' \
@@ -295,7 +295,7 @@ LINES.variable-two-times= \
# Choosing unique guard names is the responsibility of the makefile authors.
# A typical pattern of guard variable names is '${PROJECT}_${DIR}_${FILE}_MK'.
# System-provided files typically start the guard names with '_'.
-INCS+= variable-clash
+CASES+= variable-clash
LINES.variable-clash= \
${LINES.variable-if}
# expect: Parse_PushInput: file variable-clash.tmp, line 1
@@ -303,7 +303,7 @@ LINES.variable-clash= \
# The conditional must come before the assignment, otherwise the conditional
# is useless, as it always evaluates to false.
-INCS+= variable-swapped
+CASES+= variable-swapped
LINES.variable-swapped= \
'SWAPPED=' \
'.ifndef SWAPPED' \
@@ -314,7 +314,7 @@ LINES.variable-swapped= \
# If the guard variable is undefined between the first and the second time the
# file is included, the guarded file is included again.
-INCS+= variable-undef-between
+CASES+= variable-undef-between
LINES.variable-undef-between= \
'.ifndef VARIABLE_UNDEF_BETWEEN' \
'VARIABLE_UNDEF_BETWEEN=' \
@@ -326,7 +326,7 @@ UNDEF_BETWEEN.variable-undef-between= \
# If the guard variable is undefined while the file is included the first
# time, the guard does not have an effect, and the file is included again.
-INCS+= variable-undef-inside
+CASES+= variable-undef-inside
LINES.variable-undef-inside= \
'.ifndef VARIABLE_UNDEF_INSIDE' \
'VARIABLE_UNDEF_INSIDE=' \
@@ -337,7 +337,7 @@ LINES.variable-undef-inside= \
# If the file does not define the guard variable, the guard does not have an
# effect, and the file is included again.
-INCS+= variable-not-defined
+CASES+= variable-not-defined
LINES.variable-not-defined= \
'.ifndef VARIABLE_NOT_DEFINED' \
'.endif'
@@ -345,7 +345,7 @@ LINES.variable-not-defined= \
# expect: Parse_PushInput: file variable-not-defined.tmp, line 1
# The outermost '.if' must not have an '.elif' branch.
-INCS+= elif
+CASES+= elif
LINES.elif= \
'.ifndef ELIF' \
'ELIF=' \
@@ -356,7 +356,7 @@ LINES.elif= \
# When a file with an '.if/.elif/.endif' conditional at the top level is
# included, it is never optimized, as one of its branches is taken.
-INCS+= elif-reuse
+CASES+= elif-reuse
LINES.elif-reuse= \
'.ifndef ELIF' \
'syntax error' \
@@ -366,7 +366,7 @@ LINES.elif-reuse= \
# expect: Parse_PushInput: file elif-reuse.tmp, line 1
# The outermost '.if' must not have an '.else' branch.
-INCS+= else
+CASES+= else
LINES.else= \
'.ifndef ELSE' \
'ELSE=' \
@@ -377,7 +377,7 @@ LINES.else= \
# When a file with an '.if/.else/.endif' conditional at the top level is
# included, it is never optimized, as one of its branches is taken.
-INCS+= else-reuse
+CASES+= else-reuse
LINES.else-reuse= \
'.ifndef ELSE' \
'syntax error' \
@@ -388,7 +388,7 @@ LINES.else-reuse= \
# The inner '.if' directives may have an '.elif' or '.else', and it doesn't
# matter which of their branches are taken.
-INCS+= inner-if-elif-else
+CASES+= inner-if-elif-else
LINES.inner-if-elif-else= \
'.ifndef INNER_IF_ELIF_ELSE' \
'INNER_IF_ELIF_ELSE=' \
@@ -414,7 +414,7 @@ LINES.inner-if-elif-else= \
# usually chosen according to a pattern that doesn't interfere with real
# target names, they don't need to be declared '.PHONY' as they don't generate
# filesystem operations.
-INCS+= target
+CASES+= target
LINES.target= \
'.if !target(__target.tmp__)' \
'__target.tmp__: .NOTMAIN' \
@@ -425,7 +425,7 @@ LINES.target= \
# When used for system files, the target name may include '<' and '>', for
# symmetry with the '.include <sys.mk>' directive. The characters '<' and '>'
# are ordinary characters.
-INCS+= target-sys
+CASES+= target-sys
LINES.target-sys= \
'.if !target(__<target-sys.tmp>__)' \
'__<target-sys.tmp>__: .NOTMAIN' \
@@ -439,7 +439,7 @@ LINES.target-sys= \
# and once for determining the guard name. This double evaluation should not
# matter in practice, as guard expressions are expected to be simple,
# deterministic and without side effects.
-INCS+= target-indirect
+CASES+= target-indirect
LINES.target-indirect= \
'.if !target($${target-indirect.tmp:L})' \
'target-indirect.tmp: .NOTMAIN' \
@@ -452,7 +452,7 @@ LINES.target-indirect= \
# pattern based on the same idea, use __${.PARSEDIR}/${.PARSEFILE}__ instead.
# This form does not work when the basename contains whitespace characters, as
# it is not possible to define a target with whitespace, not even by cheating.
-INCS+= target-indirect-PARSEFILE
+CASES+= target-indirect-PARSEFILE
LINES.target-indirect-PARSEFILE= \
'.if !target(__$${.PARSEFILE}__)' \
'__$${.PARSEFILE}__: .NOTMAIN' \
@@ -462,7 +462,7 @@ LINES.target-indirect-PARSEFILE= \
# Two files with different basenames can both use the same syntactic pattern
# for the target guard name, as the expressions expand to different strings.
-INCS+= target-indirect-PARSEFILE2
+CASES+= target-indirect-PARSEFILE2
LINES.target-indirect-PARSEFILE2= \
'.if !target(__$${.PARSEFILE}__)' \
'__$${.PARSEFILE}__: .NOTMAIN' \
@@ -474,7 +474,7 @@ LINES.target-indirect-PARSEFILE2= \
# guard is the same as in the test case 'target-indirect-PARSEFILE', as the
# guard name only contains the basename but not the directory name. So even
# without defining the guard variable, the file is considered guarded.
-INCS+= subdir/target-indirect-PARSEFILE
+CASES+= subdir/target-indirect-PARSEFILE
LINES.subdir/target-indirect-PARSEFILE= \
'.if !target(__$${.PARSEFILE}__)' \
'.endif'
@@ -483,7 +483,7 @@ LINES.subdir/target-indirect-PARSEFILE=
# Another common form of guard target is __${.PARSEDIR}/${.PARSEFILE}__
# or __${.PARSEDIR:tA}/${.PARSEFILE}__ to be truly unique.
-INCS+= target-indirect-PARSEDIR-PARSEFILE
+CASES+= target-indirect-PARSEDIR-PARSEFILE
LINES.target-indirect-PARSEDIR-PARSEFILE= \
'.if !target(__$${.PARSEDIR}/$${.PARSEFILE}__)' \
'__$${.PARSEDIR}/$${.PARSEFILE}__: .NOTMAIN' \
@@ -495,7 +495,7 @@ LINES.target-indirect-PARSEDIR-PARSEFILE
# Using the combination of '.PARSEDIR' and '.PARSEFILE', a file in a
# subdirectory gets a different guard target name than the previous one.
-INCS+= subdir/target-indirect-PARSEDIR-PARSEFILE
+CASES+= subdir/target-indirect-PARSEDIR-PARSEFILE
LINES.subdir/target-indirect-PARSEDIR-PARSEFILE= \
'.if !target(__$${.PARSEDIR}/$${.PARSEFILE}__)' \
'__$${.PARSEDIR}/$${.PARSEFILE}__: .NOTMAIN' \
@@ -507,7 +507,7 @@ LINES.subdir/target-indirect-PARSEDIR-PA
# If the guard target is not defined when including the file the next time,
# the file is processed again.
-INCS+= target-unguarded
+CASES+= target-unguarded
LINES.target-unguarded= \
'.if !target(target-unguarded)' \
'.endif'
@@ -515,7 +515,7 @@ LINES.target-unguarded= \
# expect: Parse_PushInput: file target-unguarded.tmp, line 1
# The guard condition must consist of only the guard target, nothing else.
-INCS+= target-plus
+CASES+= target-plus
LINES.target-plus= \
'.if !target(target-plus) && 1' \
'target-plus: .NOTMAIN' \
@@ -525,7 +525,7 @@ LINES.target-plus= \
# If the guard target is defined before the file is included the first time,
# the file is read once and then considered guarded.
-INCS+= target-already-defined
+CASES+= target-already-defined
LINES.target-already-defined= \
'.if !target(target-already-defined)' \
'target-already-defined: .NOTMAIN' \
@@ -543,7 +543,7 @@ target-already-defined: .NOTMAIN
# the '\' escapes the '!' from being a dependency operator, but when reading
# the target name, the '\' is kept, resulting in the target name
# '\!target-name-exclamation' instead of '!target-name-exclamation'.
-INCS+= target-name-exclamation
+CASES+= target-name-exclamation
LINES.target-name-exclamation= \
'.if !target(!target-name-exclamation)' \
'\!target-name-exclamation: .NOTMAIN' \
@@ -557,7 +557,7 @@ LINES.target-name-exclamation= \
# generate a 'Skipping' line, the others repeat the 'Parse_PushInput' line.
#
# Some debug output lines are suppressed in the .exp file, see ./Makefile.
-.for i in ${INCS}
+.for i in ${CASES}
. for fname in $i.tmp
_:= ${fname:H:N.:@dir@${:!mkdir -p ${dir}!}@}
_!= printf '%s\n' ${LINES.$i} > ${fname}