Original URL: http://dongyulong.blog.51cto.com/1451604/449470
When the kernel compiles, do clean with make mrproper or make Distclean
When compiling the kernel, be made clean, make mrproer and make Distclean tangled, a little summed up the differences between the three:
After extracting the kernel source package, go to the top-level directory of the kernel-code 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
See Help can find the deleted file range from small to large in order: make clean < makes Mrproper < make Distclean, look at the source directory tree in the top-level directory of makefile verification, you can find:
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 ' Modules.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, when you execute make mrproper, do clean is performed, and make Mrproper is executed prior to performing Distclean.
Back to the result of make help:
Make clean deletes most of the compiled build files, but retains the kernel's configuration files. config, and enough compilation support to build the extension module
Make Mrproper Delete all compiled build files, as well as kernel configuration files, plus various backup files
Make Distclean mrproper deleted files, plus edit backup files and some patch files.
In fact, for a just download from kernel.org kernel source package, you can not execute make clean/make mrproper/make Distclean, because the state of the source package itself is clean.
In addition, even after compiling the kernel, need not clean a bit, the individual feel should be specific problem specific treatment, and see Linuxsir also have brothers on this issue have questions:
Q: Many of the kernel-compiled tutorials say make mrproper to clean up the artifacts of the previous compilation before doing. However, the compiler/linker itself examines the date of the file and determines whether a recompile/link is required. If cleared, many of the previously compiled code has to be recompiled. If this saves hard disk space, then only those modules that were previously compiled and that are no longer needed are saved, and the cost is that the compilation time is prolonged. Personally feel that the loss of the candle, at least do not need to compile every time make mrproper.
A: I do not have make mrproper, every time after modifying the kernel configuration can be completed quickly, very convenient, no problem found
If make is not sure that the files will be recompiled, what else do you have to do?
Personal opinion, the letter is not as good as the book, Practice the Truth, hehe
A: The error in not executing make mrproper depends on how intelligent the makefile is. If Makefile does not complete all the changes you have requested, it is likely that the compiled kernel will not be as good as you wish, and may even lead to panic. It is recommended to re-compile the time to pay attention to see if the changes are implemented.
When the "Go" kernel compiles, do clean with make mrproper or make Distclean (reprint)