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: Paul D. Smith
Subject: Re: Multiple target-dependent variable assignments
Date: Thu, 16 Aug 2001 12:41:37 -0400

%% 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.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://www.paulandlesley.org/gmake/
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist



reply via email to

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