Next: Alternative, Previous: Subdirectories, Up: Input files for projects with subdirectories [Contents][Index]
It is possible to define the SUBDIRS
variable conditionally if,
as in the case of GNU Inetutils, you want to only build a subset of
the entire package.
To illustrate how this works, let’s assume we have two directories
src/ and opt/. src/ should always be built, but we
want to decide in configure
whether opt/ will be built
or not. (For this example we will assume that opt/ should be
built when the variable ‘$want_opt’ was set to ‘yes’.)
Running make
should thus always recurse into src/, and
only conditionally into opt/.
However ‘make dist’ should always recurse into both src/
and opt/ unconditionally, because opt/ should be distributed even
if it is not needed in the current configuration, so
opt/Makefile needs to be created.
The main way to manage conditionally built subdirectories is to always
configure in all subdirectories. This is achieved with the DIST_SUBDIRS
variable. Alternatively, it may be possible not to configure a subdirectory
you need to distribute: see Unconfigured Subdirectories, below.
• DIST_SUBDIRS | ||
• Subdirectories with AM_CONDITIONAL | ||
• Subdirectories with AC_SUBST | ||
• Unconfigured Subdirectories |