This is the mail archive of the
automake@gnu.org
mailing list for the automake project.
Re: libtool and libraries
- From: Bob Friesenhahn <bfriesen at simple dot dallas dot tx dot us>
- To: v p <share dot knowledge at gmail dot com>
- Cc: automake at gnu dot org
- Date: Fri, 1 Oct 2004 20:36:01 -0500 (CDT)
- Subject: Re: libtool and libraries
- References: <5fa0406004100117197b2f5374@mail.gmail.com>
On Fri, 1 Oct 2004, v p wrote:
Hi,
I am a newbie and trying to use the auto tools to build my project. I
am using libtool(with autoconf/automake) to build static as well as
shared libraries. When I do 'make' the libraries are created under
'src' directory in directory '.libs'. I want the make file( generated
using automake) to create/copy these libraries to 'lib' directory
under my project root. I don't want to use 'make install' for that.
What should I do??
install-my-libs:
for library in $(lib_LTLIBRARIES) ; do \
$(LIBTOOL) --mode=install $(INSTALL) $library /usr/local/lib/$library ; \
done
should work. Then you can do 'make install-my-libs' to install just
the libraries rather than 'make install'.
A more complete version can already be found as the
'install-libLTLIBRARIES' target in Automake makefiles so you could just use
install-my-libs: install-libLTLIBRARIES
Here is the Automake version:
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f=$(am__strip_dir) \
echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
$(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
else :; fi; \
done
Bob
======================================
Bob Friesenhahn
bfriesen@simple.dallas.tx.us
http://www.simplesystems.org/users/bfriesen