help-make
[Top][All Lists]
Advanced

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

Re: Calculated Variables as Pre-requisites


From: Paul D. Smith
Subject: Re: Calculated Variables as Pre-requisites
Date: Fri, 31 Jan 2003 21:31:36 -0500

%% Alister Shipman <address@hidden> writes:

  as> - Another way of doing this is that I want a local
  as> variable for each rule, but I want that variable
  as> available at the time the pre-requisties for that rule
  as> are available 

  as> libsl_blah1.a : OBJS = 1.o 2.o 3.o
  as> libsl_blah2.a : OBJS = 4.o 5.o 6.0
  as> $(LIBRARY_LIST) : libsl_%.a : $(OBJS)

If you're doing this anyway you're basically there: you can't see the
trees for the forest :).

Instead of creating variables, just define the prerequisites!!

  libsl_blah1.a : 1.o 2.o 3.o
  libsl_blah2.a : 4.o 5.o 6.o

Then create a rule for the libraries:

  $(LIBRARY_LIST):
            $(AR) $(ARFLAGS) $@ $^

Done!

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "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]