Including Generated Files As Sources

Continuing with the previous example, the Makefile.am file contains this fragment which defines the bb_built_sources variable mentioned earlier.

bb_built_sources = \
        bb-marshal.c    \
        bb-marshal.h

bb-marshal.h: $(srcdir)/bb-marshal.list
        ...

bb-marshal.c: $(srcdir)/bb-marshal.list
        ...

The portions replaced with ellipses in the above fragment and unimportant to this discussion.

The point here is that anything that automake cannot interpret as a special instruction, it assumes is a normal Makefile code fragment and copies the literal text into the resulting Makefile.

Note also the use of the special $(srcdir) variable, which refers to the current source directory. Remember that the build directory and the source directory may not necessarily be the same, so you cannot just use the "current" directory in these situations.