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


7 Directories

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 new 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 noting 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 An Alternative Approach to Subdirectories section below.