automake: Dependency Tracking
1
1 2.2.12 Automatic Dependency Tracking
1 ------------------------------------
1
1 Dependency tracking is performed as a side-effect of compilation. Each
1 time the build system compiles a source file, it computes its list of
1 dependencies (in C these are the header files included by the source
1 being compiled). Later, any time ‘make’ is run and a dependency appears
1 to have changed, the dependent files will be rebuilt.
1
1 Automake generates code for automatic dependency tracking by default,
11 unless the developer chooses to override it; for more information, ⇒
Dependencies.
1
1 When ‘configure’ is executed, you can see it probing each compiler
1 for the dependency mechanism it supports (several mechanisms can be
1 used):
1
1 ~/amhello-1.0 % ./configure --prefix /usr
1 ...
1 checking dependency style of gcc... gcc3
1 ...
1
1 Because dependencies are only computed as a side-effect of the
1 compilation, no dependency information exists the first time a package
1 is built. This is OK because all the files need to be built anyway:
1 ‘make’ does not have to decide which files need to be rebuilt. In fact,
1 dependency tracking is completely useless for one-time builds and there
1 is a ‘configure’ option to disable this:
1
1 ‘--disable-dependency-tracking’
1 Speed up one-time builds.
1
1 Some compilers do not offer any practical way to derive the list of
1 dependencies as a side-effect of the compilation, requiring a separate
1 run (maybe of another tool) to compute these dependencies. The
1 performance penalty implied by these methods is important enough to
1 disable them by default. The option ‘--enable-dependency-tracking’ must
1 be passed to ‘configure’ to activate them.
1
1 ‘--enable-dependency-tracking’
1 Do not reject slow dependency extractors.
1
11 ⇒Dependency Tracking Evolution (automake-history)Dependency
Tracking Evolution, for some discussion about the different dependency
1 tracking schemes used by Automake over the years.
1