它是在linux内核Makefile中编写的
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在弓形医生上有这样的说法
要完成准备工作,确保内核树是绝对干净的;
$ make clean && make mrproper
那么,如果make mrproper做了更彻底的删除,为什么使用make clean呢?
发布于 2017-08-22 11:55:46
清洗是在三个级别进行的,如内核中的注释所述:
###
# Cleaning is done on three levels.
# make clean Delete most generated files
# Leave enough to build external modules
# make mrproper Delete the current configuration, and all generated files
# make distclean Remove editor backup files, patch leftover files and the like根据Makefile,mrproper目标依赖于clean目标(参见第1421行)。此外,distclean目标依赖于mrproper。
因此,执行make mrproper就足够了,因为它还将删除与clean目标所做的(以及更多)相同的事情。
mrproper目标是1993年添加的(Linux0.97.7),一直依赖于clean目标。这意味着从来没有必要像在make clean && make mrproper中那样使用这两个目标。
发布于 2017-08-22 11:54:19
clean是Makefile中mrproper目标的先决条件,因此单独执行make clean是多余的。
发布于 2022-02-23 02:43:29
在特定的指令(make clean && make mrproper)中,是的,这是没有意义的(就像说删除所有方块,然后删除所有正方形和所有三角形)...but make clean通常比make mrproper有用得多(因为在绝大多数内核构建中,您最不想要的就是丢弃您的.config).因此,也许有人这样写指令纯粹是为了提醒您注意其中的差异(即提醒您,第二部分将破坏您的.config,所以现在就支持它,如果您习惯了运行make clean,然后能够像往常一样构建的话)。
https://unix.stackexchange.com/questions/387640
复制相似问题