当前位置:网站首页>Black cat takes you to learn Makefile Part 12: Summary of common Makefile problems
Black cat takes you to learn Makefile Part 12: Summary of common Makefile problems
2022-08-10 22:00:00 【Senior black cat】
This article is compiled/written based on personal work/study experience and online data. Paid content is prohibited from being reproduced.
The column where this article is located "Black cat takes you to learn Makefile"
In the process of work/study, even if the makefile is deeply studied, there are still many miscellaneous problems. This article summarizes these problems for easy reference.
1 Pseudo-target.PHONY : Reason for clean
There are two reasons for using pseudo targets:
1. Avoid the command-only target defined in our Makefile (the purpose of this target is to execute a series of commands without creating this target) andThe actual file in the working directory has a name conflict.
2. Improve the efficiency of executing make, especially for a large-scale project, you may also care about the efficiency of compilation.
If we need to write such a rule: the defined command is not to create an object file, but to use make to specify a specific target to execute some specific commands.like below:
clean:rm *.o temp
The "rm" in the rule is not the command to create the file "clean", it just deletes all .o files and temp files in the current directory.When the file "clean" does not exist in the working directory, after we enter "make clean", "rm *.o temp" will always be executed.This is our original intention.
But when
边栏推荐
猜你喜欢
JVM经典五十问,这下面试稳了
PROCEDURE :存储过程结构——《mysql 从入门到内卷再到入土》
[SQL brush questions] Day3----Special exercises for common functions that SQL must know
JS中的filter、map、reduce
【Windows】你不能访问此共享文件夹,因为你组织的安全策略阻止未经身份验证的来宾访问,这些策略可帮助保护你的电脑
石油化工行业商业供应链管理系统:标准化供应商管理,优化企业供应链采购流程
ThreadLocal全面解析(一)
【SQL刷题】Day3----SQL必会的常用函数专项练习
LeetCode-402 - Remove K digits
Redis 性能影响 - 异步机制和响应延迟
随机推荐
MySQL高级指令
这些不可不知的JVM知识,我都用思维导图整理好了
《mysql 从入门到内卷再到入土》——Mysql基础 学习笔记目录
GAN CFOP
Mark!画出漂亮的神经网络图!神经网络可视化工具集锦搜集
xshell (sed 命令)
什么是Jmeter?Jmeter使用的原理步骤是什么?
着力提升制造业核心竞争力,仪器仪表产业迎高质量发展
ArcMap创建镶嵌数据集、导入栅格图像并修改像元数值显示范围
玩转doxygen 之RT-THREAD
工程师应该怎么学习
ThreadLocal全面解析(一)
apr_thread使用内存之谜
HighTec shortcut keys (Keys) setting location
【PCBA方案】电子握力测试仪方案she‘ji
【PCBA方案设计】蓝牙跳绳方案
Shell编程规范与变量
JVM经典五十问,这下面试稳了
直播课堂系统09--腾讯云点播管理模块(一)
UPDATE:修改数据语法使用例——《mysql 从入门到内卷再到入土》