automake: Basics of Distribution

1 
1 14.1 Basics of Distribution
1 ===========================
1 
1 The ‘dist’ rule in the generated ‘Makefile.in’ can be used to generate a
1 gzipped ‘tar’ file and other flavors of archive for distribution.  The
1 file is named based on the ‘PACKAGE’ and ‘VERSION’ variables
1 automatically defined by either the ‘AC_INIT’ invocation or by a
1 _deprecated_ two-arguments invocation of the ‘AM_INIT_AUTOMAKE’ macro
1 (see ⇒Public Macros for how these variables get their values,
1 from either defaults or explicit values – it’s slightly trickier than
1 one would expect).  More precisely the gzipped ‘tar’ file is named
1 ‘${PACKAGE}-${VERSION}.tar.gz’.  You can use the ‘make’ variable
1 ‘GZIP_ENV’ to control how gzip is run.  The default setting is ‘--best’.
1 
1    For the most part, the files to distribute are automatically found by
1 Automake: all source files are automatically included in a distribution,
1 as are all ‘Makefile.am’ and ‘Makefile.in’ files.  Automake also has a
1 built-in list of commonly used files that are automatically included if
1 they are found in the current directory (either physically, or as the
1 target of a ‘Makefile.am’ rule); this list is printed by ‘automake
1 --help’.  Note that some files in this list are actually distributed
1 only if other certain conditions hold (for example, the ‘config.h.top’
1 and ‘config.h.bot’ files are automatically distributed only if, e.g.,
1 ‘AC_CONFIG_HEADERS([config.h])’ is used in ‘configure.ac’).  Also, files
1 that are read by ‘configure’ (i.e. the source files corresponding to the
1 files specified in various Autoconf macros such as ‘AC_CONFIG_FILES’ and
1 siblings) are automatically distributed.  Files included in a
1 ‘Makefile.am’ (using ‘include’) or in ‘configure.ac’ (using
1 ‘m4_include’), and helper scripts installed with ‘automake
1 --add-missing’ are also distributed.
1 
1    Still, sometimes there are files that must be distributed, but which
1 are not covered in the automatic rules.  These files should be listed in
1 the ‘EXTRA_DIST’ variable.  You can mention files from subdirectories in
1 ‘EXTRA_DIST’.
1 
1    You can also mention a directory in ‘EXTRA_DIST’; in this case the
1 entire directory will be recursively copied into the distribution.
1 Please note that this will also copy _everything_ in the directory,
1 including, e.g., Subversion’s ‘.svn’ private directories or CVS/RCS
1 version control files; thus we recommend against using this feature
1 as-is.  However, you can use the ‘dist-hook’ feature to ameliorate the
1 problem; ⇒The dist Hook.
1 
1    If you define ‘SUBDIRS’, Automake will recursively include the
1 subdirectories in the distribution.  If ‘SUBDIRS’ is defined
1 conditionally (⇒Conditionals), Automake will normally include all
1 directories that could possibly appear in ‘SUBDIRS’ in the distribution.
1 If you need to specify the set of directories conditionally, you can set
1 the variable ‘DIST_SUBDIRS’ to the exact list of subdirectories to
1 include in the distribution (⇒Conditional Subdirectories).
1