This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: What does PWD = $${PWDCMD-pwd} do in make?
- From: "Zack Weinberg" <zack at codesourcery dot com>
- To: "H. J. Lu" <hjl at lucon dot org>
- Cc: Roland McGrath <roland at redhat dot com>, gcc at gcc dot gnu dot org
- Date: Thu, 03 Jul 2003 09:51:43 -0700
- Subject: Re: What does PWD = $${PWDCMD-pwd} do in make?
- References: <20030703005507.GA22350@lucon.org><200307030113.h631D3i01211@magilla.sf.frob.com><20030703161224.GA7077@lucon.org>
"H. J. Lu" <hjl@lucon.org> writes:
> On Wed, Jul 02, 2003 at 06:13:03PM -0700, Roland McGrath wrote:
>> > Hi Roland,
>> >
>> > I have a strange make related problem. In gcc, there is
>> >
>> > PWD = $${PWDCMD-pwd}
>>
>> This is surely ill-advised, but what it means is clear enough.
>> $$ means a literal $, and make has nothing more to do with this.
>> If this string is used in a sh command, then ${PWDCMD-pwd} is
>> sh syntax meaning $PWDCMD if that's defined and pwd otherwise.
...
I don't think there's any reason why we couldn't change this to read
PWDCMD = $${PWDCMD-pwd}
and change all uses of ${PWD} to ${PWDCMD}. Anyone know different?
Would this solve the problem you are seeing?
zw