help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: doing a string comparison with an extra level of variable reference?


From: Robert P. J. Day
Subject: Re: doing a string comparison with an extra level of variable reference?
Date: Fri, 28 Jan 2005 08:57:39 -0500 (EST)

On Fri, 28 Jan 2005, Paul D. Smith wrote:

> %% "Robert P. J. Day" <address@hidden> writes:
>
>   rpjd>   ${SUBDIRS}:
>   rpjd>         @echo "My target is address@hidden"
>   rpjd>         @echo "My makefile variable contains address@hidden"
>   rpjd>   ifneq "address@hidden" ""
>   rpjd>         @echo "Yup, that variable is set."
>   rpjd>   endif
>
> This cannot work.
>
> Make preprocessor statements are evaluated when the makefile is read in,
> just like the C/C++ preprocessor.
>
> The contents of rules, and in particular automatic variables like $@,
> are only set when the rule is invoked.

i suspected as much, and read the section "When Variables are
Expanded" in the 3rd edition of O'Reilly's make book, but it didn't
shed a lot of light.  so, really, i did try to RTFM first. :-)

thanks.

rday




reply via email to

[Prev in Thread] Current Thread [Next in Thread]