[Top][All Lists]

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

Re: [Autotools] Subdirectories in the source tree

From: Anonymous
Subject: Re: [Autotools] Subdirectories in the source tree
Date: Fri, 02 Feb 2007 01:57:58 -0600
User-agent: MT-NewsWatcher/3.4 (PPC Mac OS X)

In article <44fb00cb$0$97225$>,
 Andi Drebes <> wrote:

> I'm currently developing an application that I want to distribute now. I
> want to package everything using the autotools, so that everybody only has
> to download the tarball, run configure, make and make install.
> I already got things working with some test source files located in the same
> directory.
> But the application that I developed has a bunch of subdirectories that all
> belong to the same target. My directory structure looks like this:
> + main.cpp
> + src
>   |-- exception (directory with source files)
>   |-- handler   (directory with source files)
>   |-- number    (directory with source files)
>   |-- parser    (directory with source files)
>   |-- (some .h and .cpp files)
> + tests
>   |-- handler   (directory with source files)
>   |-- nodes     (directory with source files)
>   |-- number    (directory with source files)
>   |-- (some .h and .cpp files)
> All the files have to be compiled. Then, all the object files should be
> linked together to create an executable. That's it. A simple project, whose
> files are located in subdirectories.
> For me, it seems as if the autotools don't support subdirectories (only if
> every subdirectory represents another target). Is there a way to do the
> stuff described above in an elegant way? I would be glad if somebody could
> explain me how to do it, or send me a link with a similar project that has
> the same directory structure.
> I'm currently using:
> Debian Sarge, Kernel, autoconf 2.59, automake 1.4-p6, libtool
> 1.5.6, aclocal 1.4-p6 and bash 3.1.14(1).

Well, you could take the approach of treating the src directory
as an internal library. If contents of test are part of application,
same would apply to it as well - would normally expect contents of
test directory to contain unit tests for src directory for use with
'make check'. Anyhow, make the target of src makefile be a libtool
archive. Make target of toplevel makefile be application that links
with the libtool archive.

reply via email to

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