NetBSD-Bugs archive

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

bin/43534: make does not set $* for PHONY targets

>Number:         43534
>Category:       bin
>Synopsis:       make does not set $* for PHONY targets
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jun 27 01:15:00 +0000 2010
>Originator:     David A. Holland
>Release:        NetBSD 5.99.33 (20100627)
System: NetBSD tanaqui 5.99.22 NetBSD 5.99.22 (TANAQUI) #31: Tue Dec 8 22:53:35 
EST 2009 dholland@tanaqui:/usr/src/sys/arch/i386/compile/TANAQUI i386
Architecture: i386
Machine: i386

$* a.k.a. $(.PREFIX) is not set for targets marked .PHONY.

This problem was noted as part of PR 43502 from Wolfgang Stukenbrock,
but is a separable issue.


foo bar:
        echo $*

.PHONY: bar

   % make foo
   echo foo
   % make bar



Not entirely clear. If it's just a matter of setting it to $@ by
default, setting it along with .TARGET on/near line 1333 of make.c
should do the trick; an explicit suffix match later will replace that
setting with the right one.

However, if we want any suffix that may be present to be removed, it's
not so trivial.

Since a comment on line 2412 of suff.c says that suffix rules aren't
used with .PHONY, maybe the former is adequate. It isn't consistent
with gmake; however, gmake is hardly the gold standard and it varies
in some other ways as well.

I'd like a second opinion or two.

Home | Main Index | Thread Index | Old Index