summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2020-01-13 13:48:21 +0000
committerMarc Espie <espie@cvs.openbsd.org>2020-01-13 13:48:21 +0000
commit8ca0ceb1390f95a12ef3e79f494d43ae445c4e8d (patch)
tree34349538adfaf50142085078fe6643d3a6961ea4 /usr.bin
parent3092b4cba878fa45a2d5e4dec1ed30daf578c7cc (diff)
document special values.
unconfuse type/special field (first commit of a large patch that was ok'd tb@, millert@)
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/make/gnode.h22
-rw-r--r--usr.bin/make/parse.c6
2 files changed, 17 insertions, 11 deletions
diff --git a/usr.bin/make/gnode.h b/usr.bin/make/gnode.h
index b8a33036fbd..a6e382f289d 100644
--- a/usr.bin/make/gnode.h
+++ b/usr.bin/make/gnode.h
@@ -1,6 +1,6 @@
#ifndef GNODE_H
#define GNODE_H
-/* $OpenBSD: gnode.h,v 1.34 2019/12/22 16:53:40 espie Exp $ */
+/* $OpenBSD: gnode.h,v 1.35 2020/01/13 13:48:20 espie Exp $ */
/*
* Copyright (c) 2001 Marc Espie.
@@ -65,32 +65,38 @@
* to create this target.
*/
+/* constants for specials: built of two parts
+ * - enumerated values (1-63U) hence SPECIAL_MASK
+ * - flags that say whether it can apply to a source or a target
+ * Most of these values are only handled by parse.c.
+ * In many cases, there is a corresponding OP_* flag
+ */
#define SPECIAL_NONE 0U
-#define SPECIAL_PATH 21U
+#define SPECIAL_PATH 62U /* handled by parse.c and suff.c */
#define SPECIAL_MASK 63U
#define SPECIAL_TARGET 64U
#define SPECIAL_SOURCE 128U
#define SPECIAL_TARGETSOURCE (SPECIAL_TARGET|SPECIAL_SOURCE)
-#define SPECIAL_EXEC 4U
+#define SPECIAL_EXEC 4U
#define SPECIAL_IGNORE 5U
#define SPECIAL_NOTHING 6U
-#define SPECIAL_INVISIBLE 8U
+#define SPECIAL_INVISIBLE 8U
#define SPECIAL_JOIN 9U
#define SPECIAL_MADE 11U
#define SPECIAL_MAIN 12U
#define SPECIAL_MAKE 13U
#define SPECIAL_MFLAGS 14U
-#define SPECIAL_NOTMAIN 15U
-#define SPECIAL_NOTPARALLEL 16U
-#define SPECIAL_OPTIONAL 18U
+#define SPECIAL_NOTMAIN 15U
+#define SPECIAL_NOTPARALLEL 16U
+#define SPECIAL_OPTIONAL 18U
#define SPECIAL_ORDER 19U
#define SPECIAL_PARALLEL 20U
#define SPECIAL_PHONY 22U
#define SPECIAL_PRECIOUS 23U
#define SPECIAL_SILENT 25U
#define SPECIAL_SUFFIXES 27U
-#define SPECIAL_USE 28U
+#define SPECIAL_USE 28U
#define SPECIAL_WAIT 29U
#define SPECIAL_NOPATH 30U
#define SPECIAL_ERROR 31U
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c
index e8276b12f44..730e1267cfb 100644
--- a/usr.bin/make/parse.c
+++ b/usr.bin/make/parse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.c,v 1.123 2019/12/22 16:53:40 espie Exp $ */
+/* $OpenBSD: parse.c,v 1.124 2020/01/13 13:48:20 espie Exp $ */
/* $NetBSD: parse.c,v 1.29 1997/03/10 21:20:04 christos Exp $ */
/*
@@ -181,7 +181,7 @@ static struct {
const char *keyword;
size_t sz;
uint32_t hv;
- unsigned int type;
+ unsigned int special;
unsigned int special_op;
} specials[] = {
{ P(NODE_EXEC), SPECIAL_EXEC | SPECIAL_TARGETSOURCE, OP_EXEC, },
@@ -227,7 +227,7 @@ create_special_nodes()
for (i = 0; i < sizeof(specials)/sizeof(specials[0]); i++) {
GNode *gn = Targ_FindNodeh(specials[i].keyword,
specials[i].sz, specials[i].hv, TARG_CREATE);
- gn->special = specials[i].type;
+ gn->special = specials[i].special;
gn->special_op = specials[i].special_op;
}
}