automake
[Top][All Lists]
Advanced

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

Re: prog_DEPENDENCIES


From: Ralf Wildenhues
Subject: Re: prog_DEPENDENCIES
Date: Wed, 14 Feb 2007 16:40:03 +0100
User-agent: Mutt/1.5.13 (2007-02-12)

Hi Bob,

* Bob Rossi wrote on Wed, Feb 14, 2007 at 04:19:20PM CET:
> On Mon, Jan 29, 2007 at 07:52:02PM +0100, Ralf Wildenhues wrote:
> > > BTW, all the _DEPENDENCIES that I'm talking about are
> > > libraries that are built from my own project, but not necessarily in the
> > > same Makefile.
> > 
> > OK.  You will have to make sure these libraries exist and are up to
> > date, when they are needed.  Typically by recursing to that other
> > Makefile earlier (i.e., by way of SUBDIRS ordering).
[...]
> 
> One other question. This is in regards to libraries depending on
> libraries. If library B depends on library A, do I have to put a 
>   libB_a_DEPENDENCIES = $(top_builddir)/..../libA.a
> or does just having the SUBDIRS traverse in the correct order work?

Erm, how can a static library depend upon another static library?

If you're speaking about libtool libraries, then, given
  libB_la_LIBADD = $(top_builddir)/liba/libA.la

then Automake will put $(top_builddir)/liba/libA.la in
libB_la_DEPENDENCIES if you do not set the variable yourself.
But dependency information is only half of the issue: the other
is the rule commands to actually update it.

For this, you must still make sure the SUBDIRS ordering matches, or
alternatively also give a rule how to update the library, e.g.:
  $(top_builddir)/liba/libA.la: ...
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) libA.la

where unfortunately you'll have to either put all the actual
dependencies in the `...' position, or declare
`$(top_builddir)/liba/libA.la' as phony or so.

FWIW, I try to avoid the latter ugliness either by having SUBDIRS
ordering match, or by using (partially) nonrecursive Makefiles.

Hope that helps.

Cheers,
Ralf




reply via email to

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