This is the mail archive of the
automake@gnu.org
mailing list for the automake project.
Re: "include $(top_builddir)/aminclude.am" is ignored by automake
- From: Ralf Corsepius <rc040203 at freenet dot de>
- To: Alexandre Duret-Lutz <adl at src dot lip6 dot fr>
- Cc: Automake List <automake at gnu dot org>
- Date: Wed, 02 Feb 2005 11:46:28 +0100
- Subject: Re: "include $(top_builddir)/aminclude.am" is ignored by automake
- References: <42005C2A.3070203@users.sf.net><2005-02-02-09-02-41+9950+adl@gnu.org>
On Wed, 2005-02-02 at 09:02 +0100, Alexandre Duret-Lutz wrote:
> >>> "Tom" == Tom Howard <tomhoward@users.sf.net> writes:
>
> Tom> Hi,
> Tom> I use some m4 macros in my configure.ac that produce a file called
> Tom> aminclude.am in the top build directory. In my Makefile.am files I try
> Tom> to include this
>
> An automake include is inlined when automake runs, i.e., long
> before configure would create the file. You simply can't use
> configure output as automake input.
Right, but you can include configure output into Makefiles.
All you need to do is circumvent the pattern automake uses to catch
automake-file fragments (from automake):
...
my $INCLUDE_PATTERN = ('^include\s+'
. '((\$\(top_srcdir\)/' . $PATH_PATTERN . ')'
. '|(\$\(srcdir\)/' . $PATH_PATTERN . ')'
. '|([^/\$]' . $PATH_PATTERN . '))\s*(#.*)?' . "\
$");
...
I.e. if you want configure to generate makefile fragments and to include
_makefile_ fragments into Makefiles, you can use something like this:
MYDIR=$(top_builddir)
include $(MYDIR)/aminclude.am
However, I'd not recommend you to do this, because though this might
seem tempting at first glance, in most cases it is more troublesome than
helpful, in longer terms.
Ralf