summaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/parse.c b/parse.c
index 6d2cfb40a6e1..bbc43bd1a529 100644
--- a/parse.c
+++ b/parse.c
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.214 2016/04/06 09:57:00 gson Exp $ */
+/* $NetBSD: parse.c,v 1.217 2016/12/09 22:56:21 sjg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.214 2016/04/06 09:57:00 gson Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.217 2016/12/09 22:56:21 sjg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: parse.c,v 1.214 2016/04/06 09:57:00 gson Exp $");
+__RCSID("$NetBSD: parse.c,v 1.217 2016/12/09 22:56:21 sjg Exp $");
#endif
#endif /* not lint */
#endif
@@ -184,6 +184,7 @@ typedef struct IFile {
typedef enum {
Begin, /* .BEGIN */
Default, /* .DEFAULT */
+ DeleteOnError, /* .DELETE_ON_ERROR */
End, /* .END */
dotError, /* .ERROR */
Ignore, /* .IGNORE */
@@ -301,6 +302,7 @@ static const struct {
} parseKeywords[] = {
{ ".BEGIN", Begin, 0 },
{ ".DEFAULT", Default, 0 },
+{ ".DELETE_ON_ERROR", DeleteOnError, 0 },
{ ".END", End, 0 },
{ ".ERROR", dotError, 0 },
{ ".EXEC", Attribute, OP_EXEC },
@@ -1334,6 +1336,7 @@ ParseDoDependency(char *line)
* .BEGIN
* .END
* .ERROR
+ * .DELETE_ON_ERROR
* .INTERRUPT Are not to be considered the
* main target.
* .NOTPARALLEL Make only one target at a time.
@@ -1369,6 +1372,9 @@ ParseDoDependency(char *line)
(void)Lst_AtEnd(targets, gn);
DEFAULT = gn;
break;
+ case DeleteOnError:
+ deleteOnError = TRUE;
+ break;
case NotParallel:
maxJobs = 1;
break;
@@ -1597,7 +1603,8 @@ ParseDoDependency(char *line)
goto out;
}
*line = '\0';
- } else if ((specType == NotParallel) || (specType == SingleShell)) {
+ } else if ((specType == NotParallel) || (specType == SingleShell) ||
+ (specType == DeleteOnError)) {
*line = '\0';
}
@@ -1658,7 +1665,7 @@ ParseDoDependency(char *line)
Suff_SetNull(line);
break;
case ExObjdir:
- Main_SetObjdir(line);
+ Main_SetObjdir("%s", line);
break;
default:
break;
@@ -1858,7 +1865,7 @@ Parse_DoVar(char *line, GNode *ctxt)
* XXX Rather than counting () and {} we should look for $ and
* then expand the variable.
*/
- for (depth = 0, cp = line + 1; depth != 0 || *cp != '='; cp++) {
+ for (depth = 0, cp = line + 1; depth > 0 || *cp != '='; cp++) {
if (*cp == '(' || *cp == '{') {
depth++;
continue;