> But here VAR2 should be "foo"!

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

mart...@whitewater:~/tmp/bug-make-2009-05-07$ make var1
VAR=foo VAR2=bar VAR3=foo
mart...@whitewater:~/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:szeke...@iii.hu] 
Sent: Thursday, May 07, 2009 12:58
To: Martin Dorey
Cc: bug-make@gnu.org
Subject: Re: conditionals not working for conditional variables in sub-make?

Hi,

2009/5/7 Martin Dorey <mdo...@bluearc.com>:
> 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.


_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to