bug-make
[Top][All Lists]
Advanced

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

RE: conditionals not working for conditional variables in sub-make?


From: Martin Dorey
Subject: RE: conditionals not working for conditional variables in sub-make?
Date: Thu, 7 May 2009 14:09:17 -0700

> But here VAR2 should be "foo"!

No, it shouldn't, for exactly the same reason that VAR2 isn't foo here:

address@hidden:~/tmp/bug-make-2009-05-07$ make var1
VAR=foo VAR2=bar VAR3=foo
address@hidden:~/tmp/bug-make-2009-05-07$

Despite the number of exclamation marks, it's not clear why you think VAR2 
should be foo.  Do you think VAR was foo when make was started?  Or do you 
think that make reevaluates all the code at global scope in the context of 
every target?

-----Original Message-----
From: Szekeres István [mailto:address@hidden 
Sent: Thursday, May 07, 2009 12:58
To: Martin Dorey
Cc: address@hidden
Subject: Re: conditionals not working for conditional variables in sub-make?

Hi,

2009/5/7 Martin Dorey <address@hidden>:
> That's only a small fraction of what I see, with make-3.81.  This is what I
> see:
> [...]
> VAR=foo VAR2=bar VAR3=foo

But here VAR2 should be "foo"!!!! As VAR=foo, the ifeq then-branch
should set it to foo, but it goes into the else branch - which I think
it shouldn't do.

> Perhaps you want the "all" rule to say:
>
> all: var1 var2

No, it is different. I definitely want the sub-make because I want too
runs with VAR substituted to foo in the first run and to bar in the
second. As you can see the VAR variable picks up the right value
(do-echo outputs foo and then bar) but the ifeq does not pick up the
value, basically the ifeq(foo,foo) goes into the else branch.




reply via email to

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