Building the New Library

Next, we need to edit the SUBDIRS variable in the top-level Makefile.am file in order to include the new common directory we just added. We also need to add the new makefile that was generated in the common directory to the list of files generated from templates in the AC_CONFIG_FILES macro call in configure.ac. These changes are shown in Example 5-19 and Example 5-20.

Example 5-19. Makefile.am: Adding the common directory to the SUBDIRS variable

SUBDIRS = common src

Example 5-20. configure.ac: Adding common/Makefile to the AC_CONFIG_FILES macro

...
AC_CONFIG_FILES([Makefile
                 common/Makefile
                 src/Makefile])
...

Now let's give our updated build system a try. Add the -i option to the autoreconf command line so that it will install ...

Get Autotools now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.