Item 11: Using Generated Source Code

Automake requires that all source files used within a project be statically defined within the project's Makefile.am files, but sometimes the contents of source files need to be generated at build time.

There are two ways to deal with generated sources (more specifically, generated header files) in your projects. The first involves the use of an Automake-provided crutch for developers not interested in the finer points of make. The second involves writing proper dependency rules to allow make to understand the relationships between your source files and your products. I'll cover the crutch first, and then we'll get into the details of proper dependency management in Makefile.am files.

Using the BUILT_SOURCES ...

Get Autotools now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.