On Tue, 2015-06-02 at 17:46 +0200, Jed Brown wrote: > Paul Smith <psm...@gnu.org> writes: > > I think it's better to just always use "libfoo.a" as a prerequisite, if > > that's what you want. It's easy enough to use patsubst in the recipe to > > convert them to -l options, if you want: > > > > $(LINK.cc) -o $@ $(patsubst lib%.a,-l%,$^) > > But please don't do this because some day someone will have a libfoo.so > in their path and they'll (a) give up on your software, (b) write you > with an incomprehensible support request and waste your time, or (c) > curse you for wasting their time. Explicit is better here.
Well, of course I was assuming that your link line would add "-L." or similar so that you know that the local directory is always searched first. I don't have time to check it to be sure, but I have a vague memory that "-lfoo" and "libfoo.a" are not equivalent to the linker: for the former the linker only pulls in objects which contain symbols that are actually needed, while in the latter the link unconditionally pulls in all the objects in the library. But I could be imagining this. _______________________________________________ Help-make mailing list Help-make@gnu.org https://lists.gnu.org/mailman/listinfo/help-make