Date: Thu, 18 Apr 2002 07:10:03 -0700 (PDT) From: Ruslan Ermilov <ru@FreeBSD.org> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/37224: make: $< only set for implicit rules Message-ID: <200204181410.g3IEA3r22544@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/37224; it has been noted by GNATS.
From: Ruslan Ermilov <ru@FreeBSD.org>
To: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
Cc: bug-followup@FreeBSD.org
Subject: Re: bin/37224: make: $< only set for implicit rules
Date: Thu, 18 Apr 2002 17:06:57 +0300
 --5Mfx4RzfBqgnTE/w
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 On Thu, Apr 18, 2002 at 01:23:18PM +0200, Gerald Pfeifer wrote:
 >=20
 > .c.o:
 > 	echo $<
 >=20
 > foo: bar.c
 > 	echo $<
 >=20
 >=20
 > 	Specifically, 'make bar.o' prints bar.c, as expected, while 'make foo'
 > 	prints the empty string (as $< has not been set).
 >=20
 > 	GNU make prints bar.c in both cases, and also my reading of
 > 	IEEE Std 1003.1-2001 indicates that make(1) is incorrect here.
 >=20
 No, POSIX.1-2001 requests the $< to be defined in the "inference" rules,
 i.e., .c.o type of rules.  For "target" rules, like "foo: bar.c" above,
 it should be undefined:
 
 : $<  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.  For example,
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 :     in the .c.a inference rule, $< represents the prerequisite
 :     .c file.
 
 I think this PR can be closed.
 
 
 Cheers,
 --=20
 Ruslan Ermilov		Sysadmin and DBA,
 ru@sunbay.com		Sunbay Software AG,
 ru@FreeBSD.org		FreeBSD committer,
 +380.652.512.251	Simferopol, Ukraine
 
 http://www.FreeBSD.org	The Power To Serve
 http://www.oracle.com	Enabling The Information Age
 
 --5Mfx4RzfBqgnTE/w
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.0.6 (FreeBSD)
 Comment: For info see http://www.gnupg.org
 
 iD8DBQE8vtMAUkv4P6juNwoRAqktAJ0Y8nYdeNRKTS5ZfIYEZWv+CHnYxQCfcciF
 A1dm7hv4NeNFR39gQEUN/wU=
 =Cy4T
 -----END PGP SIGNATURE-----
 
 --5Mfx4RzfBqgnTE/w--
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200204181410.g3IEA3r22544>
