help-make
[Top][All Lists]
Advanced

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

RE: Automatic dependencies for linked libraries


From: Paul Smith
Subject: RE: Automatic dependencies for linked libraries
Date: Thu, 25 Mar 2010 18:07:59 -0400

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 <address@hidden>          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





reply via email to

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