[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
2.2.11 Preparing Distributions
We have already mentioned make dist
. This target collects all
your source files and the necessary parts of the build system to
create a tarball named ‘package-version.tar.gz’.
Another, more useful command is make distcheck
. The
distcheck
target constructs
‘package-version.tar.gz’ just as well as dist
,
but it additionally ensures most of the use cases presented so far
work:
-
It attempts a full compilation of the package (see section Basic Installation), unpacking the newly constructed tarball, running
make
,make check
,make install
, as well asmake installcheck
, and evenmake dist
, - it tests VPATH builds with read-only source tree (see section Parallel Build Trees (a.k.a. VPATH Builds)),
-
it makes sure
make clean
,make distclean
, andmake uninstall
do not omit any file (see section Standard ‘Makefile’ Targets), -
and it checks that
DESTDIR
installations work (see section Building Binary Packages Using DESTDIR).
All of these actions are performed in a temporary subdirectory, so that no root privileges are required.
Releasing a package that fails make distcheck
means that one of
the scenarios we presented will not work and some users will be
disappointed. Therefore it is a good practice to release a package
only after a successful make distcheck
. This of course does
not imply that the package will be flawless, but at least it will
prevent some of the embarrassing errors you may find in packages
released by people who have never heard about distcheck
(like
DESTDIR
not working because of a typo, or a distributed file
being erased by make clean
, or even VPATH
builds not
working).
See section Creating ‘amhello-1.0.tar.gz’, to recreate ‘amhello-1.0.tar.gz’ using
make distcheck
. See section Checking the Distribution, for more
information about distcheck
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |