当前位置:网站首页>黑猫带你学Makefile第3篇:Makefile基本语法
黑猫带你学Makefile第3篇:Makefile基本语法
2022-08-08 19:06:00 【黑猫学长呀】
本文结合个人工作/学习经验、网络资料辛苦整理/撰写而成,付费内容,禁止转载。
本文所在专栏《黑猫带你学Makefile》
对于makefile,可以认为其是一种用于代码编译的工具,也可以认为其是一种编程语言。就像python常用于数据处理/AI、C#常用来写图形化界面一样,makefile是用来实现自动化编译的一种编程语言。
之所以称makefile是一种编程语言,其原因还在于makefile也有变量、函数的概念,当然可以认为是一种编程语言。既然是一种编程语言,其一样有语法,只不过大多数人称之为“规则”。只要知道其是一个意思即可。
1 Makefile组成部分
Makefile里主要包含了五个东西:显式规则、隐晦规则、变量定义、文件指示和注释。
1.显式规则。显式规则说明了,如何生成一个或多的的目标文件。这是由Makefile的书写者明显指出,要生成的文件,文件的依赖文件,生成的命令。
2.隐晦规则。由于我们的make有自动推导的功能,所以隐晦的规则可以让我们比较粗糙地简略地书写Makefile,这是由make所支持的。
3.变量的定义。在Makefile中我们要定义一系列的变量,变量一般都是字符串,这个有点你C语言中的宏,当Makefile被执行时,其中的变量都会被扩展到相应的引用位置上。
4.文件指示。其包括了三个部分,一个是在一个Makefile中引用另一个Makefile,就像C语言中的includ
边栏推荐
- Word清除格式在哪里?Word清除格式使用方法
- 对话框管理器第六章:消息循环中的细节
- Codeforces Round #712 (Div. 2)(CD)
- golang for循环详解
- Ability in general, but it can be large horizontal jump freely?Where is the better?
- 使用 lua 运行 fscript
- 第4讲:SQL语句之DDL类型的数据库定义语言
- 01、前言
- This error is reported when the shake database is started. Is there a problem with the configuration?
- 软件测试主要是做什么的?
猜你喜欢
Redis之SDS数据结构
BP神经网络
golang for循环详解
Oracle - table
Ability in general, but it can be large horizontal jump freely?Where is the better?
疫情期间闲来无事,我自制了一个按钮展示框特效来展示我的博客
How is the private key generated by OpenSSH used in putty?
Implement the entire process of Mock API with tools
Qt界面优化:Qt窗体控件设置
能力一般,却可以大厂随便横跳?强在哪里?
随机推荐
FastDFS distributed file system
Is there any function in MAXCOMPUTE SQL to judge whether the string is a number?
Build DG will increase the amount of lead to archive log problem
什么是Shell?从小白到入门你只差一个它
Implement the entire process of Mock API with tools
数据泵导出数据报39006是什么原因
PG's huge page
室外光纤资源管理——可视化管理平台
分布式文件系统fastDFS
nyoj 712 探 寻 宝 藏(双线dp 第六届河南省程序设计大赛)
Fortinet new cloud native protection products launched amazon cloud platform of science and technology
BP neural network
Codeforces Round #722 (Div. 2)
wps表格怎么复制粘贴后与原来格式一样?
Generate captchas tools
APICloud AVM wraps date and time selection components
【kali-权限提升】(4.2.6)社会工程学工具包(上):中间人攻击原理
即将开幕!阿里云飞天技术峰会邀您一同探秘云原生最佳实践
Ability in general, but it can be large horizontal jump freely?Where is the better?
企业进行知识共享的好处有哪些?