Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make Set .PREFIX early the same place .TARGET is set...



details:   https://anonhg.NetBSD.org/src/rev/b4366e0e313d
branches:  trunk
changeset: 755940:b4366e0e313d
user:      dholland <dholland%NetBSD.org@localhost>
date:      Wed Jun 30 00:25:04 2010 +0000

description:
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:

 usr.bin/make/make.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (34 lines):

diff -r 30c9b024aa8a -r b4366e0e313d usr.bin/make/make.c
--- a/usr.bin/make/make.c       Tue Jun 29 16:58:14 2010 +0000
+++ b/usr.bin/make/make.c       Wed Jun 30 00:25:04 2010 +0000
@@ -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);
 



Home | Main Index | Thread Index | Old Index