Makefile 的多行注释
来源:互联网 发布:北宋出相 知乎 编辑:程序博客网 时间:2024/05/18 17:58
Makefile 的多行注释
Makefile Comments
注释在 makefile 中起着重要的作用,它帮助我们更快更好的理解 makefile 的内容。
# 注释符
# 字符是注释符,makefile 把 # 字符后面的内容作为注释内容处理(shell、perl 脚本也是使用 # 字符作为注释符)。如果某行的第一个非空字符为 #,则此行会被 make 解释为注释行(命令行除外,如果 Tab 字符之后使用 # 字符,则会被 make 解释为命令行)。
注释行的结尾如果存在反斜线(\),那么下一行也被作为注释行。
注释在 makefile 中起着重要的作用,它帮助我们更快更好的理解 makefile 的内容。
# 注释符
# 字符是注释符,makefile 把 # 字符后面的内容作为注释内容处理(shell、perl 脚本也是使用 # 字符作为注释符)。如果某行的第一个非空字符为 #,则此行会被 make 解释为注释行(命令行除外,如果 Tab 字符之后使用 # 字符,则会被 make 解释为命令行)。
注释行的结尾如果存在反斜线(\),那么下一行也被作为注释行。
如果需要注视多行,在注释行的结尾加行反斜线(\),下一行也被注释,可以注释多行。
建议在书写 makefile 时将注释作为一个独立的行,而不要和 makefile 的有效行放在同一行中书写。make 有时候会把 # 字符之前的内容作为有效行的内容(如定义变量的时候)。
当在 makefile 中需要使用字符 # 时,可以使用 \ 加 #(\#)来实现,表示将 # 字符作为一个普通字符而不是注释符。
示例 1
Makefile 文件的内容如下
# this makefile \
for test comments
makefile_version = 3.82 # there has two spaces before #
comments = "the \# character as the comment contents!"
print :
echo $(comments)
printf "make $(makefile_version) welcome! \n"
在命令提示符下输入 “make -s”,执行结果如下:
the # character as the comment contents!
make 3.82 welcome!
建议在书写 makefile 时将注释作为一个独立的行,而不要和 makefile 的有效行放在同一行中书写。make 有时候会把 # 字符之前的内容作为有效行的内容(如定义变量的时候)。
当在 makefile 中需要使用字符 # 时,可以使用 \ 加 #(\#)来实现,表示将 # 字符作为一个普通字符而不是注释符。
示例 1
Makefile 文件的内容如下
# this makefile \
for test comments
makefile_version = 3.82
comments = "the \# character as the comment contents!"
print :
在命令提示符下输入 “make -s”,执行结果如下:
the # character as the comment contents!
make 3.82
0 0
- Makefile 的多行注释
- Makefile 的多行注释
- vivi的Makefile注释
- makefile的注释
- makefile注释
- 一个简单的makefile示例及其注释
- 一个简单的makefile示例及其注释
- 一个简单的makefile示例及其注释
- 一个简单的makefile示例及其注释
- 对一段 makefile 脚本的详细注释
- 一个简单的makefile示例及其注释
- 一个简单的makefile示例及其注释
- 一个简单的makefile示例及其注释
- 一个简单的makefile示例及其注释
- 一个简单的makefile示例及其注释
- linux/Makefile 代码注释
- mini6410 uboot makefile 注释
- uboot-顶层Makefile注释
- x86键盘跑马灯
- HP GDCC IT 评论(comments)
- jsonObject对象与本地自定义对象相互转化
- 值得一看的英国曼彻斯特大学某技术博客
- Html5无刷新修改browser Url
- Makefile 的多行注释
- [LeetCode]26.Remove Duplicates from Sorted Array
- 关于程序员的作息安排(个人拙见)
- UVa11344 - The Huge One
- 快速积累高质量的人脉:互相推荐合适的朋友
- 使用ScheduledExecutorService接口实现Web轮询项目
- 生成自定义区间随机整数
- MSDN2012离线版
- Linux设备驱动之I2C架构分析