help-make
[Top][All Lists]
Advanced

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

Re: Usage of "eval" inside if


From: kalyan
Subject: Re: Usage of "eval" inside if
Date: Tue, 2 Dec 2008 11:12:59 +0530

Hi,
I am trying to *conditionally* define/change  some makefile variables using eval. Is there a way to acheive this?
The condition here was trivial ( if [ 1 = 0 ] ), but in reality ofcourse it would be non-trivial.

Thanks in advance.

Regards
Kalyan


On Tue, Dec 2, 2008 at 8:15 AM, Garrett Cooper <address@hidden> wrote:
On Mon, Dec 1, 2008 at 9:43 AM, Paul Smith <address@hidden> wrote:
> On Mon, 2008-12-01 at 22:52 +0530, kalyan wrote:
>> I expected the output on my console to be 0 but i got 1 ?
>> Any hints on what might be going wrong here are appreciated.
>
> There's nothing wrong :-).
>
> Make evaluates left-to-right and completely expands each variable or
> function it finds in the string before moving on to the next.
>
> So, the first thing it needs to expand is $(eval $(change_value)) and
> that sets VAR to 1.  Then it sees $(VAR) and expands that, which results
> in "1".

Indeed. I wouldn't expect less of that section of code than what you described.

What are you trying to accomplish?

-Garrett


_______________________________________________
Help-make mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/help-make


reply via email to

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