Next: , Previous: , Up: GNU Automake   [Index]


5 The top-level Makefile.am

In non-flat packages, the top level Makefile.am must tell Automake which subdirectories are to be built. This is done via the SUBDIRS variable.

The SUBDIRS macro holds a list of subdirectories in which building of various sorts can occur. Many targets (eg all) in the generated Makefile will run both locally and in all specified subdirectories. Note that the directories listed in SUBDIRS are not required to contain Makefile.ams; only Makefiles (after configuration). This allows inclusion of libraries from packages which do not use Automake (such as gettext).

In a deep package, the top-level Makefile.am is often very short. For instance, here is the Makefile.am from the textutils distribution:

SUBDIRS = lib src doc man
EXTRA_DIST = @README_ALPHA@

SUBDIRS can contain configure substitutions (eg ‘@DIRS@’); Automake itself does not actually examine the contents of this variable.

If SUBDIRS is defined, then your configure.in must include AC_PROG_MAKE_SET.