Adding Some Real Functionality

I've suggested before that you should call config.status in your makefiles to generate those makefiles from templates. Example 3-4 shows the code in that actually makes this happen. It's just a single additional macro call between the two original lines of Example 3-1.

Example 3-4. Using the AC_CONFIG_FILES macro

AC_CONFIG_FILES([Makefile src/Makefile])

This code assumes that templates exist for Makefile and src/Makefile, called and src/, respectively. These template files look exactly like their Makefile counterparts, with one exception: Any text that I want Autoconf to replace is marked as an Autoconf substitution variable, using ...

Get Autotools now with O’Reilly online learning.

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