I have definitions and rules like this:

foo_EXTRAOBJS = $(BIN)/bar.o
goo_EXTRAOBJS = $(BIN)/baz.o

$(BIN)/foo : foo.c $(foo_EXTRAOBJS)
           $(CC) $(CFLAGS) -o $@ foo.c $(foo_EXTRAOBJS)
$(BIN)/goo : goo.c $(goo_EXTRAOBJS)
           $(CC) $(CFLAGS) -o $@ goo.c $(goo_EXTRAOBJS)

Naturally, I'd like to keep my nice declarative style for specifying
extra objects that need to be linked, while using a pattern rule for
the build.  I've tried this:

$(BIN)/% : %.c $(%_EXTRAOBJS)
         $(CC) $(CFLAGS) -o $@ $< $(*_EXTRAOBJS)

Although the command seems ok, $(foo_EXTRAOBJS) is not being picked up
as a prerequisite.  I've tried quite a few other strategems too, but I
never seem to be able to get the prerequisite to work.

Can someone suggest a way to make something like this work?

Please reply to me ([EMAIL PROTECTED]) as well as the list.
Many thanks in advance.

Will


-- 
William F. Dowling
ISI/Thomson Scientific (www.isinet.com)
215-386-0100 x-1156


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

Reply via email to