Thanks, I wasn't aware of the -llib syntax for the prerequisites. Using that certainly cleans stuff up for me.
I still have some junk in there to add the library paths to vpath. I haven't figured out a better way to make the colon delimited list. I'm left with something like this. vpath lib% $(foreach d,$(patsubst -L%,%,$(filter -L%,$(LDFLAGS))),$(d):) $(TARGET): $(filter -l%,$(LDFLAGS)) > -----Original Message----- > From: Paul Smith [mailto:[email protected]] > Sent: Thursday, March 25, 2010 5:08 PM > To: Steve Deiters > Cc: make-help mailing list > Subject: RE: Automatic dependencies for linked libraries > > On Thu, 2010-03-25 at 15:58 -0500, Steve Deiters wrote: > > $(foreach d, $(patsubst -L%,%,$(filter -L%,$($(2)))),\ > $(foreach l, > > $(patsubst -l%,%,$(filter -l%,$($(2)))),\ > > $(if $(shell if [ -e $(d)/lib$(l).a ]; then echo "X"; fi),\ > > Actually now that I think about it you can probably avoid > this looping altogether and just gin up a complete list of > possible files and pass them all to wildcard at one time. > > Well, I guess you'd need one list per source file, then use > $(firstword ...) on the results to be sure you got the right > one and only the right one; I think your version above > depends on all instances of libfoo.a, for example, rather > than just the one in the first directory. > > > But, this all may be moot. Have you looked into using the "-lfoo" > format in the prerequisite lists, and setting .LIBPATTERNS? > Check out the section on "Directory Search for Link > Libraries" and see if that works for you. If not, what's missing? > > > Cheers! > > -- > -------------------------------------------------------------- > ----------------- > Paul D. Smith <[email protected]> Find some GNU make tips at: > http://www.gnu.org http://make.mad-scientist.net > "Please remain calm...I may be mad, but I am a > professional." --Mad Scientist > > _______________________________________________ Help-make mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-make
