summaryrefslogtreecommitdiff
path: root/usr.bin/make
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2014-01-06 12:15:41 +0000
committerMarc Espie <espie@cvs.openbsd.org>2014-01-06 12:15:41 +0000
commit1d929ad76ecace9f069bdee7c3a96503780d9d63 (patch)
tree05c4b2f1997f3537c9d97bc1bf661a0c9665fe8d /usr.bin/make
parent53d77633dcd188e045dbe303946e4f7b45444691 (diff)
this actually requires a comment. I would never have figured it out if
it wasn't for the arm error.
Diffstat (limited to 'usr.bin/make')
-rw-r--r--usr.bin/make/var.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c
index 48e343658ad..a926758e5f7 100644
--- a/usr.bin/make/var.c
+++ b/usr.bin/make/var.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: var.c,v 1.95 2014/01/06 12:08:18 espie Exp $ */
+/* $OpenBSD: var.c,v 1.96 2014/01/06 12:15:40 espie Exp $ */
/* $NetBSD: var.c,v 1.18 1997/03/18 19:24:46 christos Exp $ */
/*
@@ -995,9 +995,19 @@ Var_Parse(const char *str, /* The string to parse */
}
if (val == NULL) {
val = err ? var_Error : varNoError;
- /* Dynamic source */
+ /* If it comes from a dynamic source, and it doesn't have
+ * a context, copy the spec instead.
+ * Specifically, this make allows constructs like:
+ * target.o: $*.c
+ * Absence of a context means "parsing". But these can't
+ * be expanded during parsing, to be consistent with the
+ * way .SUFFIXES work.
+ * .SUFFIXES may be added/reset/removed during parsing,
+ * but in the end, the final list is what's considered for
+ * handling targets. So those dynamic variables must be
+ * handled lazily too.
+ */
if (idx != GLOBAL_INDEX) {
- /* can't be expanded for now: copy the spec instead. */
if (ctxt == NULL) {
*freePtr = true;
val = Str_dupi(str, tstr);