More specifically, I'm running with this patch

The specific choice of keywords to deprecate is up for grabs, the 
infrastructure for actually being able to error out on these keywords is
probably something I should commit anyhow.



diff --git a/gnode.h b/gnode.h
index 283fead..04e5462 100644
--- a/gnode.h
+++ b/gnode.h
@@ -77,6 +77,8 @@
 #define SPECIAL_NOTHING        6U      /* this is used for things we
                                         * recognize for compatibility but
                                         * don't do anything with... */
+#define SPECIAL_DEPRECATED     7U      /* this is an old keyword and it will
+                                        * trigger a fatal error. */
 #define SPECIAL_INVISIBLE      8U
 #define SPECIAL_JOIN           9U
 #define SPECIAL_MADE           11U
diff --git a/parse.c b/parse.c
index dfc2abc..555d2cd 100644
--- a/parse.c
+++ b/parse.c
@@ -184,13 +184,13 @@ static struct {
        unsigned int special;
        unsigned int special_op;
 } specials[] = {
-    { P(NODE_EXEC),            SPECIAL_EXEC,           OP_EXEC },
+    { P(NODE_EXEC),            SPECIAL_DEPRECATED,     OP_EXEC },
     { P(NODE_IGNORE),          SPECIAL_IGNORE,         OP_IGNORE },
-    { P(NODE_INCLUDES),                SPECIAL_NOTHING,        0 },
-    { P(NODE_INVISIBLE),       SPECIAL_INVISIBLE,      OP_INVISIBLE },
-    { P(NODE_JOIN),            SPECIAL_JOIN,           OP_JOIN },
-    { P(NODE_LIBS),            SPECIAL_NOTHING,        0 },
-    { P(NODE_MADE),            SPECIAL_MADE,           OP_MADE },
+    { P(NODE_INCLUDES),                SPECIAL_DEPRECATED,     0 },
+    { P(NODE_INVISIBLE),       SPECIAL_DEPRECATED,     OP_INVISIBLE },
+    { P(NODE_JOIN),            SPECIAL_DEPRECATED,     OP_JOIN },
+    { P(NODE_LIBS),            SPECIAL_DEPRECATED,     0 },
+    { P(NODE_MADE),            SPECIAL_DEPRECATED,     OP_MADE },
     { P(NODE_MAIN),            SPECIAL_MAIN,           0 },
     { P(NODE_MAKE),            SPECIAL_MAKE,           OP_MAKE },
     { P(NODE_MAKEFLAGS),       SPECIAL_MFLAGS,         0 },
@@ -198,7 +198,7 @@ static struct {
     { P(NODE_NOTMAIN),         SPECIAL_NOTMAIN,        OP_NOTMAIN },
     { P(NODE_NOTPARALLEL),     SPECIAL_NOTPARALLEL,    0 },
     { P(NODE_NO_PARALLEL),     SPECIAL_NOTPARALLEL,    0 },
-    { P(NODE_NULL),            SPECIAL_NOTHING,        0 },
+    { P(NODE_NULL),            SPECIAL_DEPRECATED,     0 },
     { P(NODE_OPTIONAL),                SPECIAL_OPTIONAL,       OP_OPTIONAL },
     { P(NODE_ORDER),           SPECIAL_ORDER,          0 },
     { P(NODE_PARALLEL),                SPECIAL_PARALLEL,       0 },
@@ -418,6 +418,11 @@ ParseDoSrc(
     const char *esrc)
 {
        GNode *gn = Targ_FindNodei(src, esrc, TARG_CREATE);
+       if (gn->special == SPECIAL_DEPRECATED) {
+               Parse_Error(PARSE_FATAL, "Deprecated keyword found %s\n",
+                   gn->name);
+               return;
+       }
        if (gn->special_op) {
                Array_ForEach(targets, ParseDoSpecial, gn->special_op);
                return;
@@ -702,6 +707,13 @@ handle_special_targets(Lst paths)
 
        for (i = 0; i < gtargets.n; i++) {
                type = gtargets.a[i]->special;
+               if (type == SPECIAL_DEPRECATED) {
+                       Parse_Error(PARSE_FATAL, 
+                           "Deprecated keyword found %s\n",
+                           gtargets.a[i]->name);
+                       specType = SPECIAL_ERROR;
+                       return 0;
+               }
                if (type == SPECIAL_PATH) {
                        seen_path++;
                        Lst_AtEnd(paths, find_suffix_path(gtargets.a[i]));

Reply via email to