Go to the first, previous, next, last section, table of contents.


What Goes in a Distribution

The dist target in the generated `Makefile.in' can be used to generate a gzip'd tar file for distribution. The tar file is named based on the `PACKAGE' and `VERSION' variables; more precisely it is named `package-version.tar.gz'.

For the most part, the files to distribute are automatically found by Automake: all source files are automatically included in a distribution, as are all `Makefile.am's and `Makefile.in's. Automake also has a built-in list of commonly used files which, if present in the current directory, are automatically included. This list is printed by `automake --help'. Also, files which are read by configure (ie, the source files corresponding to the files specified in the AC_OUTPUT invocation) are automatically distributed.

Still, sometimes there are files which must be distributed, but which are not covered in the automatic rules. These files should be listed in the EXTRA_DIST variable. Note that EXTRA_DIST can only handle files in the current directory; files in other directories will cause make dist runtime failures.

If you define SUBDIRS, automake will recursively include the subdirectories in the distribution. If SUBDIRS is defined conditionally (see section Conditionals), automake will normally include all directories that could possibly appear in SUBDIRS in the distribution. If you need to specify the set of directories conditionally, you can set the variable DIST_SUBDIRS to the exact list of subdirectories to include in the distribution.

Occasionally it is useful to be able to change the distribution before it is packaged up. If the dist-hook target exists, it is run after the distribution directory is filled, but before the actual tar (or shar) file is created. One way to use this is for distributing files in subdirectories for which a new `Makefile.am' is overkill:

dist-hook:
        mkdir $(distdir)/random
        cp -p random/a1 random/a2 $(distdir)/random

Automake also generates a distcheck target which can be help to ensure that a given distribution will actually work. distcheck makes a distribution, and then tries to do a VPATH build.


Go to the first, previous, next, last section, table of contents.