Module Name:    src
Committed By:   dholland
Date:           Wed Jun 30 00:25:04 UTC 2010

Modified Files:
        src/usr.bin/make: make.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/usr.bin/make/make.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/make.c
diff -u src/usr.bin/make/make.c:1.79 src/usr.bin/make/make.c:1.80
--- src/usr.bin/make/make.c:1.79	Wed Apr  7 00:11:27 2010
+++ src/usr.bin/make/make.c	Wed Jun 30 00:25:04 2010
@@ -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 @@
 
 	(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);
 

Reply via email to