Back: Language support
Forward: A Complex GNU Autotools Project
FastBack: Advanced GNU Automake Usage
Up: Advanced GNU Automake Usage
FastForward: A Complex GNU Autotools Project
Top: Autoconf, Automake, and Libtool
Contents: Table of Contents
Index: Index
About: About this document

19.3 Automatic dependency tracking

Keeping track of dependencies for a large program is tedious and error-prone. Many edits require the programmer to update dependencies, but for some changes, such as adding a #include to an existing header, the change is large enough that he simply refuses (or does it incorrectly). To fix this problem, Automake supports automatic dependency tracking.

The implementation of automatic dependency tracking in Automake 1.4 requires gcc and GNU make. These programs are only required for maintainers; the `Makefile's generated by make dist are completely portable. If you can't use gcc or GNU make for your project, then you are simply out of luck; you have to disable dependency tracking.

Automake 1.5 will include a completely new dependency tracking implementation. This new implementation will work with any compiler and any version of make.

Another limitation of the current scheme is that the dependencies included into the portable `Makefile's by make dist are derived from the current build environment. First, this means that you must use make all before you can meaningfully run make dist (otherwise the dependencies won't have been created). Second, this means that any files not built in your current tree will not have dependencies in the distributed `Makefile's. The new implementation will avoid both of these shortcomings as well.

Automatic dependency tracking is on by default; you don't have to do anything special to get it. To turn it off, either run automake -i instead of plain automake, or put `no-dependencies' into the `AUTOMAKE_OPTIONS' macro in each `'.

This document was generated by Gary V. Vaughan on February, 8 2006 using texi2html