1

I understood the difference between make clean and make mrproper.

make clean will only remove the generated files (.o/.ko) but not the configuration files and the files in include/generated, include/config.

make mrproper will remove the configuration files as well as files in include/generated, include/config.

What is the purpose of make distclean? make help says

mrproper + remove editor backup and patch files

I added a patch file using git format-patch -1, but it wasn't deleted when make distclean was executed.

2
  • Your new file was not deleted because the Makefiles had no way of knowing it should not exist.
    – Kusalananda
    Nov 5, 2019 at 13:37
  • What is the patch files which make help is referring to
    – md.jamal
    Nov 5, 2019 at 13:45

1 Answer 1

5

make distclean builds on top of make mrproper (so it deletes everything that make mrproper deletes) and in addition:

  • deletes temporary code navigation files: tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS;
  • deletes backup files: *~ #*# *%;
  • deletes what could more accurately be referred to as “patch artifacts”, i.e. files generated as a side-effect of working with patches: *.orig *.rej *.bak;
  • deletes core dumps.

It doesn’t delete files with a .patch extension, such as those generated by git format-patch.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.