help-make
[Top][All Lists]
Advanced

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

variable expansion in pattern rule prerequisites


From: Nathan Straz
Subject: variable expansion in pattern rule prerequisites
Date: Tue, 17 Aug 2004 15:49:55 -0500
User-agent: Mutt/1.5.3i

I have a makefile like this:
------------------------------
$(LIBBAR): ../lib/libbar.a
        $(MAKE) -C ../lib libbar.a
$(LIBFAR): ../lib/libfar.a
        $(MAKE) -C ../lib libfar.a

LIBS_foo := $(LIBBAR)
LIBS_boo := $(LIBFAR)

%: %.c $(LIBS_%)
        $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS) $(LIBS_$@)
------------------------------
This allows me to include libbar.a in foo and libfar.a in boo.
Unfortunately I can't figure out how to get the prereq working.  I want
foo and boo to rebuild when libbar.a and libfar.a are updated.

Can this be done with pattern rules?

-- 
Nate Straz                                              address@hidden
sgi, inc                                           http://www.sgi.com/
Linux Test Project                                  http://ltp.sf.net/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]