Automake supports an
include directive that can be used to
include other Makefile fragments when
automake is run.
Note that these fragments are read and interpreted by
make. As with conditionals,
make has no idea that
include is in use.
There are two forms of
Include a fragment that is found relative to the current source directory.
Include a fragment that is found relative to the top source directory.
Note that if a fragment is included inside a conditional, then the condition applies to the entire contents of that fragment.
Makefile fragments included this way are always distributed because they are needed to rebuild Makefile.in.
Inside a fragment, the construct
%reldir% is replaced with the
directory of the fragment relative to the base Makefile.am.
%canon_reldir% is replaced with the canonicalized
(see Canonicalization) form of
%reldir%. As a convenience,
%D% is a synonym for
is a synonym for
A special feature is that if the fragment is in the same directory as
the base Makefile.am (i.e.,
%canon_reldir% will expand to the empty
string as well as eat, if present, a following slash or underscore
Thus, a makefile fragment might look like this:
bin_PROGRAMS += %reldir%/mumble %canon_reldir%_mumble_SOURCES = %reldir%/one.c