manpagez: man pages & more
info autoconf
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.8.5 Automatic Remaking

You can put rules like the following in the top-level ‘’ for a package to automatically update the configuration information when you change the configuration files. This example includes all of the optional files, such as ‘aclocal.m4’ and those related to configuration header files. Omit from the ‘’ rules for any of these files that your package does not use.

The ‘$(srcdir)/’ prefix is included because of limitations in the VPATH mechanism.

The ‘stamp-’ files are necessary because the timestamps of ‘’ and ‘config.h’ are not changed if remaking them does not change their contents. This feature avoids unnecessary recompilation. You should include the file ‘’ in your package’s distribution, so that make considers ‘’ up to date. Don’t use touch (see Limitations of Usual Tools); instead, use echo (using date would cause needless differences, hence CVS conflicts, etc.).

$(srcdir)/configure: aclocal.m4
        cd '$(srcdir)' && autoconf

# autoheader might not change, so touch a stamp file.
$(srcdir)/ aclocal.m4
        cd '$(srcdir)' && autoheader
        echo timestamp > '$(srcdir)/'

config.h: stamp-h
stamp-h: config.status

Makefile: config.status

config.status: configure
        ./config.status --recheck

(Be careful if you copy these lines directly into your makefile, as you need to convert the indented lines to start with the tab character.)

In addition, you should use

AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])

so ‘config.status’ ensures that ‘config.h’ is considered up to date. See section Outputting Files, for more information about AC_OUTPUT.

See section config.status Invocation, for more examples of handling configuration-related dependencies.

[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on April 26, 2012 using texi2html 5.0.

© 2000-2019
Individual documents may contain additional copyright information.