Rolling Distribution Tarballs

There's something about the word `tarballs' that make you want to avoid them altogether, let alone get involved in the disgusting process of rolling one. And, in the past, that was apparently the attitude of most developers, as witnessed by the strange ways distribution tar archives were created and unpacked. Automake largely automates this tedious process, in a sense providing you with the obliviousness you crave.

Introduction to Distributions

The basic approach to creating a tar distribution is to run
     make
     make dist
      

The generated tar file is named package-version.tar.gz, and will unpack into a directory named package-version. These two rules are mandated by the GNU Coding Standards, and are just good ideas in any case, because it is convenient for the end user to have the version information easily accessible while building a package. It removes any doubt when she goes back to an old tree after some time away from it. Unpacking into a fresh directory is always a good idea - in the old days some packages would unpack into the current directory, requiring an annoying clean-up job for the unwary system administrator.

The unpacked archive is completely portable, to the extent of Automake's ability to enforce this. That is, all the generated files (e.g., configure) are newer than their inputs (e.g., configure.in), and the distributed Makefile.in files should work with any version of make. Of course, some of the responsibility for portability lies with you: you are free to introduce non-portable code into your Makefile.am, and Automake can't diagnose this. No special tools beyond the minimal tool list (see Minimal Tool List: (standards)Utilities in Makefiles.) plus whatever your own Makefile and configure additions use, will be required for the end user to build the package.

By default Automake creates a .tar.gz file. It notices if you are using GNU tar and arranges to create portable archives in this case. [1]

People do sometimes want to make other sorts of distributions. Automake allows this through the use of options.

dist-bzip2

Add a dist-bzip2 target, which creates a .tar.bz2 file. These files are frequently smaller than the corresponding .tar.gz file.

dist-shar

Add a dist-shar target, which creates a shar archive.

dist-zip

Add a dist-zip target, which creates a zip file. These files are popular for Windows distributions.

dist-tarZ

Add a dist-tarZ target, which creates a .tar.Z file. This exists mostly for die-hard old-time Unix hackers; the rest of the world has moved on to gzip or bzip2.

Notes

[1]

By default, @sc{gnu} @code{tar} can create non-portable archives in certain (rare) situations. To be safe, Automake arranges to use the @samp{-o} compatibility flag when @sc{gnu} @code{tar} is used.