[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Automake also generates a distcheck
target which can be of help
to ensure that a given distribution will actually work.
distcheck
makes a distribution, then tries to do a VPATH
build, run the testsuite, and finally make another tarfile to ensure the
distribution is self-contained.
Building the package involves running ./configure
. If you need
to supply additional flags to configure
, define them in the
DISTCHECK_CONFIGURE_FLAGS
variable, either in your top-level
`Makefile.am', or on the commande line when invoking make
.
If the target distcheck-hook
is defined in your
`Makefile.am', then it will be invoked by distcheck
after
the new distribution has been unpacked, but before the unpacked copy is
configured and built. Your distcheck-hook
can do almost
anything, though as always caution is advised. Generally this hook is
used to check for potential distribution errors not caught by the
standard mechanism.
Speaking about potential distribution errors, distcheck
will also
ensure that the distclean
target actually removes all built
files. This is done by running make distcleancheck
at the end of
the VPATH
build. By default, distcleancheck
will run
distclean
and then make sure the build tree has been emptied by
running $(distcleancheck_listfiles)
. Usually this check will
find generated files that you forgot to add to the DISTCLEANFILES
variable (see section 14. What Gets Cleaned).
The distcleancheck
behaviour should be ok for most packages,
otherwise you have the possibility to override the definitition of
either the distcleancheck
target, or the
$(distcleancheck_listfiles)
variable. For instance to disable
distcleancheck
completely, add the following rule to your
top-level `Makefile.am':
distcleancheck: @: |
If you want distcleancheck
to ignore built files which have not
been cleaned because they are also part of the distribution, add the
following definition instead:
distcleancheck_listfiles = \ find -type f -exec sh -c 'test -f $(scrdir)/{} || echo {}' |
The above definition is not the default because it's usually an error if your Makefiles cause some distributed files to be rebuilt when the user build the package. (Think about the user missing the tool required to build the file; or if the required tool is built by your package, consider the cross-compilation case where it can't be run.)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |