%% "Derek M. Flynn" <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]>          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

_______________________________________________
Bug-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-make

Reply via email to