For simple projects that distribute all files in the same directory it is enough to have a single Makefile.am that builds everything in place.
In larger projects, it is common to organize files in different directories, in a tree. For example, there could be a directory for the program’s source, one for the testsuite, and one for the documentation; or, for very large projects, there could be one directory per program, per library or per module.
The traditional approach is to build these subdirectories recursively,
employing make recursion: each directory contains its
own Makefile, and when
make is run from the top-level
directory, it enters each subdirectory in turn, and invokes there a
make instance to build the directory’s contents.
Because this approach is very widespread, Automake offers built-in support for it. However, it is worth nothing that the use of make recursion has its own serious issues and drawbacks, and that it’s well possible to have packages with a multi directory layout that make little or no use of such recursion (examples of such packages are GNU Bison and GNU Automake itself); see also the Alternative section below.
|• Subdirectories:||Building subdirectories recursively|
|• Conditional Subdirectories:||Conditionally not building directories|
|• Alternative:||Subdirectories without recursion|
|• Subpackages:||Nesting packages|