make clean、 make mrproper、make distclean的区别

本文介绍Linux内核编译过程中的三种清理命令:make clean、make mrproper及make distclean的区别与联系。从删除文件范围来看,make clean<make mrproper<make distclean,且执行更高级别清理命令时会包含低级别命令的功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

$ 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

make clean                    删除大多数的编译生成文件, 但是会保留内核的配置文件.config, 还有足够的编译支持来建立扩展模块
make mrproper             删除所有的编译生成文件, 还有内核配置文件, 再加上各种备份文件
make distclean              mrproper删除的文件, 加上编辑备份文件和一些补丁文件。


删除的文件范围从小到大依次为: make clean < make mrproper < make distclean


从Makefile中可以看到:执行make mrproper,会先执行make clean;执行make distclean,会先执行make mrproper
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值