bug-make
[Top][All Lists]
Advanced

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

[bug #18305] target specific variables with conditional assignments


From: Paul D. Smith
Subject: [bug #18305] target specific variables with conditional assignments
Date: Wed, 10 Jun 2009 02:47:54 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.10) Gecko/2009042513 Ubuntu/8.04 (hardy) Firefox/3.0.10

Update of bug #18305 (project make):

              Item Group:                     Bug => Enhancement            

    _______________________________________________________

Follow-up Comment #1:

Hm.  The way conditional variables work is that the "conditionality" of the
variable is determined when the variable is assigned (in immediate context),
not when the variable is expanded.  When we evaluate the variable assignment
in "lib: TARGET ?= two" we don't have the inheritance of the "all" target in
scope yet, because that doesn't happen until make actually runs the makefile. 
So at the time that we evaluation "conditionality" there is no other value in
scope.

Now actually I lied a little bit because even if you set "TARGET = global" as
a global setting, which clearly IS in-scope when the target-specific variable
is set, the result will still be "two".  That's because conditionality only
looks at variables assigned in the same scope.

I don't know if this is really a bug or not.  On the one hand it seems like
it would be useful to allow conditional assignments such as you describe, but
to do that we'd need to change the way variables work to defer the conditional
decision until runtime, which means saving the conditional value.  That
clearly doesn't make sense for global variables since they can be decided
right then, so it would only be for target/pattern-specific variables.  I'd
rather do it all or nothing rather than have global settings work one way and
inherited target vars work another.

I'm marking this as an enhancement request, although it's probably a bug
that, at least, the docs don't make clear how this works.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?18305>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

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