This is the mail archive of the automake@gnu.org mailing list for the automake project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: "include $(top_builddir)/aminclude.am" is ignored by automake


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





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]