Cleaning kernel sources

There are three make targets for cleaning the kernel source tree:

  • clean: removes object files and most intermediates.
  • mrproper: removes all intermediate files, including the .config file. Use this target to return the source tree to the state it was in immediately after cloning or extracting the source code. If you are curious about the name, Mr Proper is a cleaning product common in some parts of the world. The meaning of make mrproper is to give the kernel sources a really good scrub.
  • distclean: This is the same as mrproper but also deletes editor backup files, patch leftover files, and other artifacts of software development.

Get Mastering Embedded Linux Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.