Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/make Don't accept dependencies for .BEGIN, .END, and...
details: https://anonhg.NetBSD.org/src/rev/ce531520c741
branches: trunk
changeset: 580598:ce531520c741
user: christos <christos%NetBSD.org@localhost>
date: Sun May 01 01:25:36 2005 +0000
description:
Don't accept dependencies for .BEGIN, .END, and .INTERRUPT since they
don't make sense or work anyway.
diffstat:
usr.bin/make/make.h | 3 ++-
usr.bin/make/parse.c | 15 ++++++++++-----
2 files changed, 12 insertions(+), 6 deletions(-)
diffs (73 lines):
diff -r 250e795bca59 -r ce531520c741 usr.bin/make/make.h
--- a/usr.bin/make/make.h Sun May 01 01:14:30 2005 +0000
+++ b/usr.bin/make/make.h Sun May 01 01:25:36 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: make.h,v 1.52 2004/07/15 09:01:29 yamt Exp $ */
+/* $NetBSD: make.h,v 1.53 2005/05/01 01:25:36 christos Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -253,6 +253,7 @@
* children was out-of-date */
#define OP_MADE 0x00000800 /* Assume the children of the node have
* been already made */
+#define OP_NODEP 0x00001000 /* Dependencies are invalid */
#define OP_USEBEFORE 0x00002000 /* Like .USE, only prepend commands */
#define OP_INVISIBLE 0x00004000 /* The node is invisible to its parents.
* I.e. it doesn't show up in the parents's
diff -r 250e795bca59 -r ce531520c741 usr.bin/make/parse.c
--- a/usr.bin/make/parse.c Sun May 01 01:14:30 2005 +0000
+++ b/usr.bin/make/parse.c Sun May 01 01:25:36 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.97 2005/02/16 15:11:52 christos Exp $ */
+/* $NetBSD: parse.c,v 1.98 2005/05/01 01:25:36 christos Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.97 2005/02/16 15:11:52 christos Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.98 2005/05/01 01:25:36 christos 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.97 2005/02/16 15:11:52 christos Exp $");
+__RCSID("$NetBSD: parse.c,v 1.98 2005/05/01 01:25:36 christos Exp $");
#endif
#endif /* not lint */
#endif
@@ -937,7 +937,7 @@
ParseDoDependency(char *line)
{
char *cp; /* our current position */
- GNode *gn; /* a general purpose temporary node */
+ GNode *gn = NULL; /* a general purpose temporary node */
int op; /* the operator on the line */
char savec; /* a place to save a character */
Lst paths; /* List of search paths to alter when parsing
@@ -1089,7 +1089,7 @@
case End:
case Interrupt:
gn = Targ_FindNode(line, TARG_CREATE);
- gn->type |= OP_NOTMAIN;
+ gn->type |= OP_NOTMAIN|OP_NODEP;
(void)Lst_AtEnd(targets, (ClientData)gn);
break;
case Default:
@@ -1260,6 +1260,11 @@
}
line = cp;
+ if (gn && (gn->type & OP_NODEP) && *line)
+ Parse_Error(PARSE_FATAL,
+ "Cannot specify dependency `%s' for target `%s'",
+ line, gn->name);
+
/*
* Several special targets take different actions if present with no
* sources:
Home |
Main Index |
Thread Index |
Old Index