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
