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.