Can I actually rely on Automake making a verbatim
    copy of the include line from Makefile.am to Makefile.im?

As far as I can make out, your logic is exactly correct. Looking at
the bin/automake script, I see:

my $PATH_PATTERN = '(\w|[+/.-])+';
# This will pass through anything not of the prescribed form.
my $INCLUDE_PATTERN = ('^include\s+'
                       . '((\$\(top_srcdir\)/' . $PATH_PATTERN . ')'
                       . '|(\$\(srcdir\)/' . $PATH_PATTERN . ')'
                       . '|([^/\$]' . $PATH_PATTERN . '))\s*(#.*)?' . "\$");

The first two alternatives are the ones mentioned in 
https://www.gnu.org/software/automake/manual/automake.html#Include

The third matches any "plain" filename ("foobar", but not "foo/bar"), I
think? Then, in the code that handles this (approx line 6700ff.),
$(srcdir) is prepended. This is apparently a feature not documented in
the manual -- a plain "include foo" turns into "include
$(srcdir)/foo". I think. Does that seem right to you? Clearly a
desirable feature, but missed in the manual, it seems.

Anyway, for your purposes, as soon you include a / or other
non-$PATH_PATTERN character in the include argument, Automake leaves it
alone and copies it. I can't conceive of changing that now, so yes, I
think it is reasonably safe for you to rely on it.

    and the Makefile.am rules therefore now look as follows, for the benefit

Thank you very much for posting all this. --happy hacking, karl.

Reply via email to