autoconf
[Top][All Lists]
Advanced

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

Re: Inter-project building and dependency management?


From: Ralf Wildenhues
Subject: Re: Inter-project building and dependency management?
Date: Fri, 5 Sep 2008 15:15:28 +0200
User-agent: Mutt/1.5.17+20080114 (2008-01-14)

* Eric Jonas wrote on Fri, Sep 05, 2008 at 03:01:35PM CEST:
> 
> noinst_LTLIBRARIES = libstream.la
> libstream_la_SOURCES = $(cc_sources) $(source_sources)
> libstream_la_CXXFALGS = $(AM_CXXFLAGS)

You can just drop this line (it will simplify the resulting Makefile a
bit).  Also note the typo FALGS vs. FLAGS.

> libstream_la_LIBADD=  @top_srcdir@/src/vis/libstreamvis.la

Please replace @top_srcdir@ with $(top_builddir): a library is never
built in the source tree.  If you are inside src/ you can just write
  libstream_la_LIBADD=  vis/libstreamvis.la

> In my unittests dir, at project/unittest, I have a Makefile.am which
> incorporates this per some very useful help from this list: 
> 
> runner_SOURCES =  runner.cc  $(test_sources)
> runner_LDADD = @top_srcdir@/src/libstream.la

Likewise, please replace @top_srcdir@ with $(top_builddir).
Relinking due to updated libstream.la should work then.

> However, if I make a source change in my src directory and then run make
> from my unittests directory, there are no recompiles triggered. I am
> assuming this is because from unittest/Makefile.am's perspective, the
> included library hasn't changed. 

Ah, if you 'make' from the unittests dir (as opposed to from the
toplevel dir) then you can put something like this in
unittests/Makefile.am:

$(top_builddir)/src/libstream.la:
        cd $(top_builddir)/src && $(MAKE) $(AM_MAKEFLAGS) libstream.la
.PHONY: $(top_builddir)/src/libstream.la

Note that this will make the build a bit less efficient though, as you
effectively traverse parts of the tree twice, if you run 'make' from the
toplevel build tree.

Later on, you may want to look into nonrecursive builds (see 'info
Automake Alternative').

BTW, this is all really Automake specific.

Cheers,
Ralf




reply via email to

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