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.
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 Other Automake variables) form of
%reldir%. As a
%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