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

Garrett Cooper gcooper at FreeBSD.org
Mon Jun 21 04:00:12 UTC 2010


The following reply was made to PR bin/148024; it has been noted by GNATS.

From: Garrett Cooper <gcooper at FreeBSD.org>
To: Garrett Wollman <wollman at hergotha.csail.mit.edu>
Cc: freebsd-gnats-submit at freebsd.org
Subject: Re: bin/148024: Some built-in AT&T/POSIX compat make variables are 
	broken
Date: Sun, 20 Jun 2010 20:56:23 -0700

 On Sun, Jun 20, 2010 at 7:46 PM, Garrett Wollman
 <wollman at hergotha.csail.mit.edu> wrote:
 > In article
 > <mit.lcs.mail.freebsd-bugs/201006210044.o5L0iPXK000857 at www.freebsd.org>,
 > gcooper at freebsd.org writes:
 >
 >>foo: bar
 >> =A0 =A0 =A0 @echo target: $@ prereq: $<
 >>$ make -f ~/Makefile.prereq foo
 >>target: foo prereq:
 >>
 >>The above invocation should have printed out:
 >>
 >>target: foo prereq: bar
 >
 > No. =A0$< is only defined for pattern rules.
 >
 >>$<
 >> =A0 =A0In 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.
 > =A0 =A0 =A0 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
     Ok.. this appears to be a GNU make `extension':
 
 $ gmake -f ~/Makefile.prereq yadda.a
 target: yadda.a prereq: bazinga.b
 target: yadda.a prereq:
 target: prereq:
 $ make -f ~/Makefile.prereq yadda.a
 target: yadda.a prereq:
 target: yadda.a prereq: bazinga.b
 target: yadda.a prereq: bazinga.b
 $ bmake -f ~/Makefile.prereq yadda.a
 target: yadda.a prereq:
 target: yadda.a prereq: bazinga.b
 target: yadda.a prereq: bazinga.b
 $ cat ~/Makefile.prereq
 .b.a:
 	echo target: $@ prereq: $<
 
 bazinga.b:
 
 yadda.a: bazinga.b
 	@echo target: $@ prereq: $<
 	@echo target: $@ prereq: $>
 	@echo target: ${.TARGET} prereq: ${.ALLSRC}
 
     Is an inference rule the .b.a rule? POSIX doesn't properly define
 what it is and assumes you know what's going on (lousy documentation)
 :(...
 Thanks,
 -Garrett


More information about the freebsd-bugs mailing list