autoconf
[Top][All Lists]
Advanced

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

Re: source code in several directories


From: Bob Proulx
Subject: Re: source code in several directories
Date: Mon, 10 Sep 2007 14:13:35 -0600
User-agent: Mutt/1.5.9i

address@hidden wrote:
> I've been trying to write down the necessary configure.ac and Makefile.am
> files but I'm having problems related to directory structure (so I think)

You may not realize this but you are actually asking an automake
question but posted it to the autoconf mailing list.  I will answer
anyway but if there is any followup needed please send the additional
automake questions to the automake list.  Thanks.

> ------ src     (only .c files)
> ------ include (only .h files)
> 
> I was trying to write one Makefile.am in src and another in the upper dir.

Sounds fine to me so far.

> I can do make, but make distcheck always fails no matter what.

Unfortunately without knowing what errors you are seeing from
distcheck we have no way of helping you with that part of the
problem.

> I've tried several approaches but I never get complete success. So
> I'm guessing the directory structure is messing things up. I can
> _not_ touch the directoyy structure !!!

The directory structure seems fine to me.  Not one I could choose but
it does work okay.  I have worked with other projects with a similar
structure with includes off to the side.

> - how do I tell the tools that all headers are to be found in the include
> dir ? in the top-level Makefile.am or in the src one ? what goes in each
> of them ?

In the src/Makefile.am file add a cpp include directory that tells the
compiler to look for the include files in the "include" directory.
Your hand build Makefiles would have needed something similar.  Simply
use the same options for automake to use too.

This adds directory relative to the src directory to the include
directory.  This would be my personal preference.

  AM_CPPFLAGS = -I$(srcdir)/../include

This adds a directory relative to the top level source directory.  I
could not guess at what your exact directory structure would be and
you will need to adjust this as needed to match your hierarchy.

  AM_CPPFLAGS = -I$(top_srcdir)/ourlib/include

Use one or the other, not both.  I showed two example choices.

In the "include" directory I would use the noinst_HEADERS variable to
define the list of headers.

  noinst_HEADERS = foo.h bar.h

The make distcheck target should be fine with this.

Bob




reply via email to

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