[Top][All Lists]

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

Re: Library containing sources of multiple directories

From: Ralf Wildenhues
Subject: Re: Library containing sources of multiple directories
Date: Tue, 6 Dec 2005 19:06:56 +0100
User-agent: Mutt/1.5.11

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's for
> existing projects.

Look at GraphicsMagick for example.  ;-)
Look at

> 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 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;

include geom/

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

,-- geom/sub/
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).


reply via email to

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