From owner-freebsd-bugs@FreeBSD.ORG Mon Jun 21 15:30:06 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD9E21065670 for ; Mon, 21 Jun 2010 15:30:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 833C78FC08 for ; Mon, 21 Jun 2010 15:30:06 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o5LFU6Kq026269 for ; Mon, 21 Jun 2010 15:30:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o5LFU6Pn026264; Mon, 21 Jun 2010 15:30:06 GMT (envelope-from gnats) Date: Mon, 21 Jun 2010 15:30:06 GMT Message-Id: <201006211530.o5LFU6Pn026264@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Garrett Cooper Cc: Subject: Re: bin/148024: Some built-in AT&T/POSIX compat make variables are broken X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Garrett Cooper List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 15:30:06 -0000 The following reply was made to PR bin/148024; it has been noted by GNATS. From: Garrett Cooper To: Garrett Cooper Cc: Garrett Wollman , bug-followup Subject: Re: bin/148024: Some built-in AT&T/POSIX compat make variables are broken Date: Mon, 21 Jun 2010 08:21:18 -0700 On Mon, Jun 21, 2010 at 8:20 AM, Garrett Cooper wrote= : > On Sun, Jun 20, 2010 at 8:56 PM, Garrett Cooper wro= te: >> On Sun, Jun 20, 2010 at 7:46 PM, Garrett Wollman >> wrote: >>> In article >>> = , >>> gcooper@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 filena= me >>>>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 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> >> =A0 =A0Ok.. 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: >> =A0 =A0 =A0 =A0echo target: $@ prereq: $< >> >> bazinga.b: >> >> yadda.a: bazinga.b >> =A0 =A0 =A0 =A0@echo target: $@ prereq: $< >> =A0 =A0 =A0 =A0@echo target: $@ prereq: $> >> =A0 =A0 =A0 =A0@echo target: ${.TARGET} prereq: ${.ALLSRC} >> >> =A0 =A0Is 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) >> :(... > > =A0 =A0It appears that the ultimate problem here is that POSIX does a > lousy job at defining Makefiles and general purpose make terms (which > was ultimately causing confusion at my end). I'll go prod the > opengroup folks to improve their definitions and nomenclature. (so basically I was asking for the bug to be closed)