bin/148024: Some built-in AT&T/POSIX compat make variables are broken

Bruce Evans brde at optusnet.com.au
Mon Jun 21 13:37:16 UTC 2010


On Mon, 21 Jun 2010, Garrett Wollman wrote:

> In article
> <mit.lcs.mail.freebsd-bugs/201006210044.o5L0iPXK000857 at www.freebsd.org>,
> gcooper at 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


More information about the freebsd-bugs mailing list