Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

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

13.5 Implementation

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 February, 8 2006 using texi2html

 
 
  Published under the terms of the Open Publication License Design by Interspire