%% "Alexandre P. Nunes" <[EMAIL PROTECTED]> writes:

  apn> I have a question: How in GNU make (I have 3.79.1) do I do
  apn> something like:

  apn> TARGETS := foo bar
  apn> foo_OBJS := test.o bleah.o
  apn> bar_OBJS := bar.o dumb.o bleah.o

  apn> $(TARGETS): $($@_OBJS) whatever.a

  apn> I mean, to have each one of the targets referenced by $(TARGETS)
  apn> to depend on it's own setting on targetname_OBJS. Is there a way
  apn> to do this using GNU make?

Not directly.

The only thing you can do right now is use make's auto-re-exec feature
to include a makefile that provides all these definitions.  If you
provide a make rule to create it then make will build it when it's out
of date, and the re-exec itself to include it.

  TARGETS := foo bar
  foo_OBJS := test.o bleah.o
  bar_OBJS := bar.o dumb.o bleah.o

  include prereqs.mk

  prereqs.mk: Makefile
        @rm -f $@; \
         for t in $(TARGETS); do \
           echo "$$t : \$$($$t_OBJS) whatever.a" >> $@; \
         done

or whatever (the above is untested).

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

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

Reply via email to