Differences between make clean, make mrproper, and make distclean

Source: Internet
Author: User

Whether to use make clean, make mrproper or make distclean during kernel Compilation

Make clean, make mrproer, and make distclean are involved in compiling the kernel. The differences between the three are summarized below:
Decompress the kernel source code package, go to the top-level directory of the kernel source code directory tree, and execute
# Make help
Cleaning targets:

Clean-remove most generated files but keep the config and enough build support to build external modules

Mrproper-Remove all generated files + config + various backup files

Distclean-mrproper + remove editor backup and patch files

Result of make help:
Make clean deletes most of the compilation and generation files, but retains the Kernel configuration file. config. There is enough compilation support to create extension modules.
Make mrproper deletes all compilation files, Kernel configuration files, and various backup files.
Make distclean mrproper deleted files, and edit Backup files and patch files.

You can see that the deleted files are in ascending order: Make clean <make mrproper <make distclean. Check the makefile in the top-level directory of the source code directory tree for verification. You can find that:
Clean: archclean $ (Clean-dirs)
$ (Call cmd, rmdirs)
$ (Call cmd, rmfiles)
@ Find. $ (rcs_find_ignore )\
\ (-Name '*. [OAS]'-o-name' *. Ko '-o-name'. *. cmd '\
-O-name '. *. d'-o-name'. *. tmp '-o-name' *. Mod. c '\
-O-name '*. symtypes'-o-name 'Les. order '\
-O-name 'module. markers '\)\
-Type F-print | xargs Rm-F

Mrproper: Clean archmrproper $ (mrproper-dirs)
$ (Call cmd, rmdirs)
$ (Call cmd, rmfiles)

Distclean: mrproper
@ Find $ (srctree) $ (rcs_find_ignore )\
\ (-Name '*. orig'-o-name '*. rej'-o-name '*~ '\
-O-name '*. Bak'-o-name' # * #'-o-name'. *. orig '\
-O-name '. *. rej'-o-size 0 \
-O-name '* %'-o-name '. *. CMD'-o-name 'core '\)\
-Type F-print | xargs Rm-F
That is to say, if you execute make mrproper, make mrproper will be executed first. Before you execute make distclean, make mrproper will be executed first.

In fact, for a kernel source code package just downloaded from kernel.org, you do not need to execute make clean/make mrproper/make distclean, because the source code package status itself is clean.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.