bug-make
[Top][All Lists]
Advanced

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

Re: variables as dependencies expanded immediately


From: Paul D. Smith
Subject: Re: variables as dependencies expanded immediately
Date: Mon, 18 Mar 2002 17:58:21 -0500

%% "Derek M. Flynn" <address@hidden> writes:

  dmf> I'm using GNU make 3.79.1.  The following makefile illustrates the
  dmf> problem I am observing:

  dmf> FOO_LIB = -lm

  dmf> all : foo bar
  dmf> foo : foo.o $(FOO_LIB)
  dmf> bar : bar.o $(BAR_LIB)

  dmf> BAR_LIB = -lm

  dmf> whereas foo builds as expected, when GNU make tries to link bar.o
  dmf> to make bar, the expansion of $(BAR_LIB) is empty:

  dmf> It is as if the variables are immediately expanded.  Is that expected?

Absolutely.

See the GNU make manual, section _How 'make' Reads a Makefile_.

-- 
-------------------------------------------------------------------------------
 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]