[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: a couple questions about variable assignment and wildcards
From: |
Paul D. Smith |
Subject: |
Re: a couple questions about variable assignment and wildcards |
Date: |
Mon, 7 Jun 2004 15:28:03 -0400 |
%% "Robert P. J. Day" <address@hidden> writes:
rpjd> objects = *.o
rpjd> objects := $(wildcard *.o)
vs.
rpjd> objects = $(wildcard *.o)
rpjd> objects := *.o
rpjd> the first again, i would guess, is a deferred assignment, with
rpjd> the actual value of '$(wildcard *.o)' which will be evaluated
rpjd> when used. how can i print the actual value of a variable
rpjd> without having it evaluated?
If you have GNU make 3.80 you can use the $(value ...) function. If you
don't, you can't do it.
Note this is only relevant for the $(wildcard) line. The *.o doesn't
contain any variable or function values, so it always returns *.o.
rpjd> and that last statement is an immediate assignment, right? so
rpjd> that the wildcard expansion is done before assignment, as long
rpjd> as something matches that pattern.
GNU make doesn't do wildcarding when expanding a variable that contains
a "*". The result of evaluating that value is always the literal string
'*.o'.
The wildcarding may be done by the user of that string, but it isn't
handled during the expansion of the variable.
--
-------------------------------------------------------------------------------
Paul D. Smith <address@hidden> Find some GNU make tips at:
http://www.gnu.org http://make.paulandlesley.org
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist