make clean、make mrproer 以及make distclean的区别

本文详细介绍了在Makefile中常用的清理命令`make clean`、`make mrproper`和`make distclean`的区别。`make clean`主要用于删除目标文件和编译过程中产生的临时文件;`make mrproper`除了`clean`的功能外,还会移除配置信息,确保项目回到初始状态;`make distclean`是最彻底的清理,它会删除所有构建、配置以及依赖生成的文件,以便于进行源码包的重新构建和分发。

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

 make clean、make mrproer 以及make distclean的区别

解压内核源码包后, 到内核源代码目录树的顶层目录, 执行
# 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 < make mrproper < make distclean, 查看源码目录树的顶层目录下的Makefile求证, 可以发现:
clean: archclean $(clean-dirs)
        $(call cmd,rmdirs)
        $(call cmd,rmfiles)
        @find . $(RCS_FIND
评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值