DIST_SUBDIRS
DIST_SUBDIRS
lists subdirectories that are recursed into by
‘make maintainer-clean’,
‘make distclean’ and ‘make dist’.
All
other recursive rules use SUBDIRS
,
which contains the subdirectories of the current directory
that must be built (see Subdirectories).
It must be defined
manually; Automake will never guess a directory is to be built. As we
will see in the next two sections, it is possible to define it
conditionally so that some directory will be omitted from the build.
SUBDIRS
should always be a subset of DIST_SUBDIRS
.
In our example, opt must always
appear in DIST_SUBDIRS
.
as we always want to distribute it,
However, ‘opt’ may not always appear in
SUBDIRS
,
There are two ways to give DIST_SUBDIRS
a value:
SUBDIRS
is defined conditionally using Automake
conditionals, Automake will define DIST_SUBDIRS
automatically
from the possible values of SUBDIRS
in all conditions.
SUBDIRS
contains AC_SUBST
variables,
DIST_SUBDIRS
will not be defined correctly because Automake
does not know the possible values of these variables. In this case
DIST_SUBDIRS
needs to be defined manually.
These are shown in the following two sections.