On Mon, 21 Jun 2010, Garrett Wollman wrote:

In article
<mit.lcs.mail.freebsd-bugs/201006210044.o5l0ipxk000...@www.freebsd.org>,
gcoo...@freebsd.org writes:

>foo: bar
>    @echo target: $@ prereq: $<
>$ make -f ~/Makefile.prereq foo
>target: foo prereq:

This doesn't look like a POSIX makefile (IIRC the original mail shows
a cat command to show the whole makefile).  A POSIX makefile must begin
with a .POSIX special target.  See sys.mk.  The POSIX support in sys.mk
probably doesn't actually work right, but that is another bug.  (Most
recently I noticed breakage of the POSIX mandated rules by encrufting
them with CTFCONVERT shell commands.)

>The above invocation should have printed out:
>
>target: foo prereq: bar

No.  $< is only defined for pattern rules.

>$<
>    In an inference rule, the $< macro shall evaluate to the filename
>whose existence allowed the inference rule to be chosen for the target.
>In the .DEFAULT rule, the $< macro shall evaluate to the current target
>name. The meaning of the $< macro shall be otherwise unspecified.
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Strange wording.  It commands itself the not specifiy something that it
doesn't specify.  Anyway, this means that the makefile is more non-POSIX
than just its missing .POSIX.

Bruce
_______________________________________________
freebsd-bugs@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"

Reply via email to