automake
[Top][All Lists]
Advanced

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

Re: Individual install targets with libtool


From: Ralf Wildenhues
Subject: Re: Individual install targets with libtool
Date: Fri, 16 Sep 2005 09:09:32 +0200
User-agent: Mutt/1.4.1i

Hi Marc,

* Marc Rossi wrote on Thu, Sep 15, 2005 at 05:50:47PM CEST:
> I have a Makefile with multiple libtool targets:
> 
> lib_LTLIBRARIES = libx.a liby.a libz.a

(By the way, LTLIBRARIES are supposed to end with .la.  See the
documentation.)

> I would like to do a make install for a liby.a ONLY. 
> When I look through the generated Makefile I only see
> the ability to make install all 3 at once.

I'm not quite sure what you want to achieve, so I'll give a couple of
hints:

If you are developing a package and want to allow the user to install
only a subset of the libraries built, which she chooses at configure
time, you could use Automake conditionals, like:
# in configure.ac something like (after making sure libx_wanted
# is somehow set to something sensible)
AM_CONDITIONAL([WANT_LIBX], [test "$libx_wanted" = true])

# in Makefile.am 
lib_LTLIBRARIES =
if WANT_LIBX
lib_LTLIBRARIES += libx.la
endif


If instead you insist on `make install' time choice, you could work
around the limitation somehow like this:

lib_LTLIBRARIES = libx.la
libydir = $(libdir)
liby_LTLIBRARIES = liby.la
libzdir = $(libdir)
libz_LTLIBRARIES = libz.la

This approach does not scale very well, and I you might have to tweak
the order they are given for `make install' to install them in the
correct order (given they depend upon each other).  Oh, I forgot: you
may install each of them now by using an undocumented feature of
Automake: it will produce different targets for each of the directories.
(Can't remember the exact name, so I'm not writing it here, it's
an implementation detail anyway; Makefile.in will show you :)

But I have a much more general question: why do you want to do this
anyway?  The answer might lead to a much better solution for your actual
problem.

Cheers,
Ralf




reply via email to

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