summaryrefslogtreecommitdiff
path: root/usr.bin/make/make.c
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2010-06-30 00:25:04 +0000
committerdholland <dholland@NetBSD.org>2010-06-30 00:25:04 +0000
commitd6bfe606f5e1e99b49ce550fb094baa1d5ea4fbd (patch)
tree36b0fcb5a9c36d53d22c5d071615f0c9524a9e4c /usr.bin/make/make.c
parent42faad5b094ea0767235a6d3c9769542bb4ade2c (diff)
Set .PREFIX early the same place .TARGET is set. This makes sure it's
defined even in cases where the suffix search logic is skipped, such as .PHONY targets, and fixes PR 43534. Note: because .PHONY targets do not get suffix searching, .PREFIX will not have any suffixes removed. This seems vaguely logical, although it's not the only reasonable interpretation. We may also want to reconsider whether suffix rules are skipped for phony targets, too. That behavior is somewhat counterintuitive.
Diffstat (limited to 'usr.bin/make/make.c')
-rw-r--r--usr.bin/make/make.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/make/make.c b/usr.bin/make/make.c
index 11e2ca8cba3..d44971dc700 100644
--- a/usr.bin/make/make.c
+++ b/usr.bin/make/make.c
@@ -1,4 +1,4 @@
-/* $NetBSD: make.c,v 1.79 2010/04/07 00:11:27 sjg Exp $ */
+/* $NetBSD: make.c,v 1.80 2010/06/30 00:25:04 dholland Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: make.c,v 1.79 2010/04/07 00:11:27 sjg Exp $";
+static char rcsid[] = "$NetBSD: make.c,v 1.80 2010/06/30 00:25:04 dholland Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)make.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: make.c,v 1.79 2010/04/07 00:11:27 sjg Exp $");
+__RCSID("$NetBSD: make.c,v 1.80 2010/06/30 00:25:04 dholland Exp $");
#endif
#endif /* not lint */
#endif
@@ -1331,6 +1331,7 @@ Make_ExpandUse(Lst targs)
(void)Dir_MTime(gn);
Var_Set(TARGET, gn->path ? gn->path : gn->name, gn, 0);
+ Var_Set(PREFIX, gn->name, gn, 0);
Lst_ForEach(gn->children, MakeUnmark, gn);
Lst_ForEach(gn->children, MakeHandleUse, gn);