Author vstinner
Recipients barry, eric.smith, vstinner
Date 2013-06-27.07:36:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Extract of "GNU standards":

# make distclean
#      Delete all files from the current directory that are created by
#      configuring or building the program.  If you have unpacked the
#      source and built the program without creating any other files,
#      `make distclean' should leave only the files that were in the
#      distribution.

Python should only remove files generated by the build process: Makefile, pyconfig.h, *.o, etc. But not files generated by Mercurial (.orig, .rej), backup files (.old, .bak), nor any other files which is not generated by the build. These files may be important for the developer (Mercurial keeps modified files after "hg revert --all" for example).

If someone wants an hardcore cleaner, the command can be kept, but please, under a different name.

I use "make distclean" when I change compiler options (rerun Makefile), when a new C file is added (calling "make" is usually not enough, and I prefer to restart from a "clean" source tree), or more generally when Python doesn't compile for an unknown reason. For example, "make distclean" was need when the new _stat (Modules/_stat.c) module was added.

R. David Murray wrote on python-dev: "We also sometimes ask someone reporting an issue to do a make distclean and recompile (...)".

Here is a patch simply removing the "find -exec rm {};" command from "make distclean". Remaining commands:

# Make things extra clean, before making a distribution:
# remove all generated files, even Makefile[.pre]
# Keep configure and Python-ast.[ch], it's possible they can't be generated
distclean: clobber
        for file in Lib/test/data/* ; do \
            if test "$$file" != "Lib/test/data/README"; then rm "$$file"; fi; \
        -rm -f core Makefile Makefile.pre config.status \
                Modules/Setup Modules/Setup.local Modules/Setup.config \
                Modules/ld_so_aix Modules/python.exp Misc/python.pc
        -rm -f python*
Date User Action Args
2013-06-27 07:36:17vstinnersetrecipients: + vstinner, barry, eric.smith
2013-06-27 07:36:17vstinnersetmessageid: <>
2013-06-27 07:36:17vstinnerlinkissue18312 messages
2013-06-27 07:36:16vstinnercreate