help-make
[Top][All Lists]
Advanced

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

RE: Multiple target-dependent variable assignments


From: Nestor Amaya
Subject: RE: Multiple target-dependent variable assignments
Date: Fri, 17 Aug 2001 13:15:26 -0400

Hi Paul,

Thank you for your time (yet again). My apologies for treating "+=" and "$a
= $a" equivalently... I do understand the difference, but I forgot to edit
my makefile back to "+=" prior to sending the testcase. What I sent was just
an experiment, which I guess does highlight the "bug" that you mentioned
w.r.t. recursive self-reference... 

My issue still remains however: Whether the variable A is declared to be
recursive or simple, the following makefile still yields "a d" as a result,
instead of the anticipated "a b c d" result.

        #==================== makefile  ==============================
        A := a   # or A = a
                         
        nc_gates : A += b
        nc_gates : A += c
        nc_gates : A += d
                         
        nc_gates :       
                @echo $A 

Shouldn't this work?

Thank you,

Nestor




%% Nestor Amaya <address@hidden> writes:

  na> I may have found a bug with GNU make 3.79.1, but I thought I would
  na> run it by you guys first. I am using "+=" assignments to the same
  na> variable in multiple target-dependant cases:

No, you're not :).

  na> #==================== makefile  ==============================
  na> A = a

  na> nc_gates : A = b $A
  na> nc_gates : A = c $A
  na> nc_gates : A = d $A

  na> nc_gates :
  na>   @echo $A

  na> make results in the following output:
  na> % make
  na> d a

  na> Of course, I expect something more like "b c d a", but the order
  na> doesn't matter to me. Isn't this a bug?

No, because you're not using "+=", you're using just "=".

Actually, there _is_ a bug because you should get a fatal error about
recursive references to $A... that's been fixed for the next version.

If you were to use "+=" and removed the trailing $A and got that
response, then it would be a bug.  Or, if you used ":=" instead of just
"=" and got that response, that would also be a bug.


It turns out that there _is_ a bug in 3.79.1 WRT += (but := works); this
has already been fixed in the source and will be available in the next
version.



reply via email to

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