Hi Daniel,

* Daniel Kraft wrote on Tue, Dec 06, 2005 at 05:12:38PM CET:
> 
> I'm new at developing with the GNU build system (automake), and now I've tried
> to "port" an existing project to use an automake-based build system; 
> therefore I
> read some tutorials I found on the WWW, and I also looked at Makefile.am's for
> existing projects.

Look at GraphicsMagick for example.  ;-)
Look at
http://www-src.lip6.fr/homepages/Alexandre.Duret-Lutz/autotools.html

> My problem is that my project contains one big library which is built of many
> source files spread over different sub-directories. As far as I know I could
> build the library by a Makefile.am like:
> 
> lib_LIBRARIES = libGeomExakt.a
> libGeomExakt_a_SOURCES = dir1/a.cpp dir2/b.cpp
> ...
> 
> I.e., mentioning every file in the top-level Makefile. But this isn't what I
> want; it would be far more convenient to list the sources in the
> sub-directories;

,-- Makefile.am:
lib_LIBRARIES =
include geom/Makefile.am
`--

,-- geom/Makefile.am
lib_LIBRARIES += geom/libGeomExact.a
geom_libGeomExact_a_SOURCES = geom/foo.c
include geom/sub/Makefile.am
`--

,-- geom/sub/Makefile.am
geom_libGeomExact_a_SOURCES += geom/sub/bar.c
`---

> Is this something possible with automake? Or do I need to write special
> makefile-constructs for that (e.g., a small library of every directory's
> sources) my own?

Yeah, you can do that, too, at least with libtool.  But unless there's
compelling reasons, I wouldn't do it.  Some people prefer during
development it because it does not rebuild so much (exactly because the
recursive make does not have all dependency information available).

Cheers,
Ralf


Reply via email to