[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: |
Robert P. J. Day |
Subject: |
Re: a couple questions about variable assignment and wildcards |
Date: |
Mon, 7 Jun 2004 15:35:19 -0400 (EDT) |
On Mon, 7 Jun 2004, Paul D. Smith wrote:
> %% "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.
i'm about to upgrade from FC1 to FC2, so i may get make 3.80 in the
process. if not, i'll just manually upgrade.
> 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.
gotcha. thanks.
rday