< 上一个 | 内容 | 下一个 >

distcleancheck

Speaking of potential distribution errors, distcheck also ensures that the distclean rule 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 Chapter 13 [Clean], page 96).

The distcleancheck behavior should be OK for most packages, otherwise you have the possibility to override the definition of either the distcleancheck rule, 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 that 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 $(srcdir)/$$1 || echo $$1’ \ sh ’{}’ ’;’

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.) There is an entry in the FAQ about this (see Section 28.5 [Errors with distclean], page 142), make sure you read it before playing with distcleancheck_listfiles.