On Tue, 2009-09-22 at 11:11 -0700, Philip Guenther wrote:
which by the way, is not well-formed; it should be:
mkdir -p $@ && cd $@ && $(MAKE)
I am afraid I cannot use the "gnuisms" (as they were called by a
NetBSD user
who was bitten by these variables when I used them)
Whoever told you that is sadly mistaken. The '@' and 'MAKE' variables
are both specified by the POSIX/SUS standard for make and were present
in 4.2 BSD! It's handy to keep around a link to the standards
specification for quoting at people that are, uh, confused about
history and requirements. Here's the link for 'make' from the Single
UNIX Standard, Issue 6.
http://www.opengroup.org/onlinepubs/009695399/utilities/make.html
The NetBSD user is definitely incorrect in calling these "GNUisms"; they
are part of the POSIX spec as you point out.
However, it is true that using $@ in they way I suggested is not 100%
portable.
In one of those bizarre brain-lapses that make you go "huh?", original
versions of make only defined automatic variables like $@ for implicit
(suffix) rules. They were not defined for explicit rules. Some
instances of make still do not support them in explicit rules, so
maximally portable makefiles can only use $@ in suffix rules.