[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Variable confusion
From: |
Paul Smith |
Subject: |
Re: Variable confusion |
Date: |
Tue, 15 Jun 2010 11:13:19 -0400 |
On Tue, 2010-06-15 at 15:51 +0200, Gary wrote:
> Sorry. Can't see for looking, can I! I mean the echo produces the
> -I burble, while the invocation of the "compiler" (gpp -x blah) shows
> the command "`find ...".
Ah. Yes, Greg explained that to you. The variable contains whatever
string you provided, which in this case is a backquoted command. Make
doesn't _interpret_ that string, it just stores it.
Then you use it in a command, and the string is passed to the shell (but
still as a string, not the expansion of the string). Then the shell
runs that command.
You probably would have been able to figure it out faster if you'd not
had the "@" hiding the echo command. Then you would have seen this:
>> $ make echo
>> echo `find ${LIB_ROOT} -type d \! \( -name '.*' -prune \) | sed -e 's/^/-I
>> /'`
>> -x --curdirinclast -I ../lib -I ../lib/db -I ../lib/ewz -I ../lib/ewz/ws -I
>> ../lib/net -I ../lib/net/protocol -I ../lib/net/protocol/http
And this:
>> $ make echo
>> echo `find ${LIB_ROOT} -type d \! \( -name '.*' -prune \) | sed -e 's/^/-I
>> /'`
>> -x --curdirinclast -I ../lib -I ../lib/db -I ../lib/ewz -I ../lib/ewz/ws -I
>> ../lib/net -I ../lib/net/protocol -I ../lib/net/protocol/http
>> gpp -x --curdirinclast `find ../lib -type d \! \( -name '.*' -prune \) | sed
>> -e 's/^/-I /'` -o FOO.php FOO.gpp
Using "@" is very handy once your makefile is completed and you don't
want to bother people with details, but I find that most of the time
it's just hiding potentially important information when makefiles are
being developed.
--
-------------------------------------------------------------------------------
Paul D. Smith <address@hidden> Find some GNU make tips at:
http://www.gnu.org http://make.mad-scientist.net
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist