13.5 Implementation

back: some caveats
forward: installing and uninstalling
fastback: rolling distribution tarballs
up: rolling distribution tarballs
fastforward: installing and uninstalling
top: autoconf, automake, and libtool
contents: table of contents
index: index
about: about this document

In order to understand how to use the more advanced dist - related features, you must first understand how make dist is implemented. For most packages, what we've already covered will suffice. Few packages will need the more advanced features, though I note that many use them anyway.

The dist rules work by building a copy of the source tree and then archiving that copy. This copy is made in stages: a `Makefile' in a particular directory updates the corresponding directory in the shadow tree. In some cases, automake is run to create a new `Makefile.in' in the new distribution tree.

After each directory's `Makefile' has had a chance to update the distribution directory, the appropriate command is run to create the archive. Finally, the temporary directory is removed.

If your `Makefile.am' defines a dist-hook rule, then Automake will arrange to run this rule when the copying work for this directory is finished. This rule can do literally anything to the distribution directory, so some care is required -- careless use will result in an unusable distribution. For instance, Automake will create the shadow tree using links, if possible. This means that it is inadvisable to modify the files in the `dist' tree in a dist hook. One common use for this rule is to remove files that erroneously end up in the distribution (in rare situations this can happen). The variable `distdir' is defined during the dist process and refers to the corresponding directory in the distribution tree; `top_distdir' refers to the root of the distribution tree.

Here is an example of removing a file from a distribution:

 dist-hook:         -rm $(distdir)/remove-this-file 

This document was generated by Gary V. Vaughan on May, 24 2001 using texi2html

GNU Autoconf, Automake and Libtool
GNU Autoconf, Automake, and Libtool
ISBN: 1578701902
EAN: 2147483647
Year: 2002
Pages: 290

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net