List Info

Thread: Subdirectories in the source tree




Subdirectories in the source tree
user name
2006-09-03 16:21:31
Hi everybody!
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 2.6.17.11, autoconf 2.59, automake
1.4-p6, libtool
1.5.6, aclocal 1.4-p6 and bash 3.1.14(1).

        Thanks in advance,
                Andi
_______________________________________________
help-gnu-utils mailing list
help-gnu-utilsgnu.org

http://lists.gnu.org/mailman/listinfo/help-gnu-utils
Re: Subdirectories in the source tree
user name
2007-02-02 01:57:58
In article <44fb00cb$0$97225$892e7fe2authen.yellow.readfreenews.net>,
 Andi Drebes <webmasterprogrammierforen.de>
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 2.6.17.11, 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.
_______________________________________________
help-gnu-utils mailing list
help-gnu-utilsgnu.org

http://lists.gnu.org/mailman/listinfo/help-gnu-utils

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )