关闭

GNU make man手册(中文版)

标签: makefilewildcardlistarchivefilter测试
435人阅读 评论(0) 收藏 举报
分类:

目录
GNU make中文手册.....................................................................................................................1
ver - 3.8.......................................................................................................................................1
第一章:概述...............................................................................................................................7
1.1 Make之前基本知识:.......................................................................................................7
1.1.1 概述............................................................................................................................7
1.1.2 准备知识....................................................................................................................8
1.2 GNU make 介绍..............................................................................................................8
1.2.1 Makefile简介.............................................................................................................9
1.2.2 Makefile规则介绍....................................................................................................10
1.2.3 简单的示例...............................................................................................................11
1.2.4 make如何工作.........................................................................................................12
1.2.5 指定变量..................................................................................................................13
1.2.6 自动推导规则...........................................................................................................14
1.2.7 另类风格的makefile.................................................................................................15
1.2.8 清除工作目录过程文件.............................................................................................16
第二章:Makefile 总述..............................................................................................................16
2 Makefile概述........................................................................................................................16
2.1 Makefile的内容..............................................................................................................16
2.2 makefile文件的命名.......................................................................................................18
2.3 包含其它makefile文件...................................................................................................18
2.4 变量 MAKEFILES.........................................................................................................20
2.5 变量 MAKEFILE_LIST..................................................................................................21
2.6 其他特殊变量.................................................................................................................22
2.7 makefile文件的重建......................................................................................................22
2.8 重载另外一个makefile...................................................................................................23
2.9 make如何解析makefile文件..........................................................................................24
2.9.1 变量取值..................................................................................................................25
2.9.2 条件语句..................................................................................................................25
2.9.3 规则的定义...............................................................................................................25
2.10 总结...............................................................................................................................25
第三章:Makefile的规则............................................................................................................26
3 Makefile规则........................................................................................................................26
3.1 一个例子........................................................................................................................27
3.2 规则语法........................................................................................................................27
3.3 依赖的类型.....................................................................................................................28
3.4 文件名使用通配符..........................................................................................................29
3.4.1 统配符使用举例........................................................................................................30
3.4.2 通配符存在的缺陷....................................................................................................30
3.4.3 函数wildcard...........................................................................................................31
3.5 目录搜寻........................................................................................................................32
3.5.1 一般搜索(变量VPATH)........................................................................................32
3.5.2 选择性搜索(关键字vpath)....................................................................................32
3.5.3 目录搜索的机制........................................................................................................33
3.5.4 命令行和搜索目录....................................................................................................35
3.5.5 隐含规则和搜索目录.................................................................................................36
GUN make中文手册
2004年9月11日 3
3.5.6 库文件和搜索目录....................................................................................................36
3.6 Makefile伪目标..............................................................................................................37
3.7 强制目标(没有命令或依赖的规则).............................................................................40
3.8 空目标文件.....................................................................................................................41
3.9 Makefile的特殊目标.......................................................................................................41
3.10 多目标............................................................................................................................44
3.11 多规则目标.....................................................................................................................44
3.12 静态模式........................................................................................................................45
3.12.1 静态模式规则的语法.......................................................................................45
3.12.2 静态模式和隐含规则.......................................................................................47
3.13 双冒号规则.....................................................................................................................48
3.14 自动产生依赖.................................................................................................................49
第四章:规则的命令..................................................................................................................51
4 规则中书写命令...................................................................................................................51
4.1 命令回显........................................................................................................................51
4.2 命令的执行.....................................................................................................................52
4.3 并发执行命令.................................................................................................................53
4.4 命令执行的错误..............................................................................................................54
4.5 中断make的执行............................................................................................................56
4.6 make的递归执行............................................................................................................56
4.6.1 变量MAKE...............................................................................................................57
4.6.2 变量和递归...............................................................................................................58
4.6.3 命令行选项和递归....................................................................................................61
4.6.4 -w选项......................................................................................................................63
4.7 定义命令包.....................................................................................................................63
4.8 空命令............................................................................................................................65
第五章:Makefile中的变量.........................................................................................................65
5 使用变量..............................................................................................................................65
5.1 变量的引用.....................................................................................................................66
5.2 两种变量定义(赋值)...................................................................................................68
5.2.1 递归展开式变量........................................................................................................68
5.2.2 直接展开式变量........................................................................................................69
5.2.3 如何定义一个空格....................................................................................................70
5.2.4 “?=”操作符.............................................................................................................71
5.3 变量的高级用法..............................................................................................................71
5.3.1 变量的替换引用........................................................................................................72
5.3.2 变量的套嵌引用........................................................................................................72
5.4 变量取值........................................................................................................................76
5.5 如何设置变量.................................................................................................................76
5.6 追加变量值.....................................................................................................................77
5.7 override 指示符.............................................................................................................79
5.8 多行定义........................................................................................................................80
5.9 系统环境变量.................................................................................................................81
5.10 目标指定变量.................................................................................................................83
5.11 模式指定变量.................................................................................................................84
第六章:Makefile的条件执行.....................................................................................................85
6 Makefile的条件判断.............................................................................................................85
6.1 一个例子........................................................................................................................85
6.2 条件判断的基本语法......................................................................................................86
GUN make中文手册
2004年9月11日 4
6.3 标记测试的条件语句......................................................................................................89
第七章:make的内嵌函数..........................................................................................................89
7 make的函数.........................................................................................................................89
7.1 函数的调用语法..............................................................................................................90
7.2 文本处理函数.................................................................................................................91
7.2.1 $(subst FROM,TO,TEXT).......................................................................................91
7.2.2 $(patsubst PATTERN,REPLACEMENT,TEXT).....................................................91
7.2.3 $(strip STRINT).......................................................................................................92
7.2.4 $(findstring FIND,IN)..............................................................................................92
7.2.5 $(filter PATTERN…,TEXT).....................................................................................93
7.2.6 $(filter-out PATTERN...,TEXT)...............................................................................93
7.2.7 $(sort LIST).............................................................................................................94
7.2.8 $(word N,TEXT)......................................................................................................94
7.2.9 $(wordlist S,E,TEXT)..............................................................................................94
7.2.10 $(words TEXT)..............................................................................................94
7.2.11 $(firstword NAMES…)..................................................................................95
7.3 文件名处理函数..............................................................................................................95
7.3.1 $(dir NAMES…)......................................................................................................95
7.3.2 $(notdir NAMES…).................................................................................................96
7.3.3 $(suffix NAMES…).................................................................................................96
7.3.4 $(basename NAMES…).........................................................................................96
7.3.5 $(addsuffix SUFFIX,NAMES…).............................................................................97
7.3.6 $(addprefix PREFIX,NAMES…).............................................................................97
7.3.7 $(join LIST1,LIST2).................................................................................................98
7.3.8 $(wildcard PATTERN)............................................................................................98
7.4 foreach 函数.................................................................................................................98
7.5 if 函数.........................................................................................................................100
7.6 call函数.......................................................................................................................100
7.7 value函数....................................................................................................................102
7.8 eval函数......................................................................................................................103
7.9 origin函数...................................................................................................................104
7.10 shell函数.....................................................................................................................106
7.11 make的控制函数..........................................................................................................106
7.11.1 $(error TEXT…)...........................................................................................107
7.11.2 $(warning TEXT…)......................................................................................107
第八章:执行make..................................................................................................................108
8 执行make..........................................................................................................................108
8.1 指定makefile文件........................................................................................................108
8.2 指定终极目标...............................................................................................................109
8.3 替代命令的执行............................................................................................................111
8.4 防止特定文件重建........................................................................................................112
8.5 替换变量定义...............................................................................................................113
8.6 使用make进行编译测试...............................................................................................114
8.7 make的命令行选项......................................................................................................115
第九章:make的隐含规则........................................................................................................119
9 使用隐含规则.....................................................................................................................119
9.1 隐含规则的使用............................................................................................................119
9.2 make的隐含规则一览..................................................................................................121
9.3 隐含变量......................................................................................................................124
9.3.1 代表命令的变量......................................................................................................124
9.3.2 命令参数的变量......................................................................................................125
9.4 make隐含规则链..........................................................................................................126
GUN make中文手册
2004年9月11日 5
9.5 模式规则......................................................................................................................128
9.5.1 模式规则介绍.........................................................................................................128
9.5.2 模式规则示例.........................................................................................................129
9.5.3 自动化变量.............................................................................................................130
9.5.4 模式的匹配.............................................................................................................133
9.5.5 万用规则................................................................................................................133
9.5.6 重建内嵌隐含规则..................................................................................................134
9.6 缺省规则......................................................................................................................135
9.7 后缀规则......................................................................................................................135
9.8 隐含规则搜索算法........................................................................................................137
第十章:使用make更新静态库文件.........................................................................................138
10 更新静态库文件............................................................................................................138
10.1 库成员作为目标............................................................................................................138
ARCHIVE(MEMBER)..............................................................................................................138
10.2 静态库的更新...............................................................................................................139
10.2.1 更新静态库的符号索引表..............................................................................140
10.3 make静态库的注意事项...............................................................................................141
10.4 静态库的后缀规则........................................................................................................141
第十一章 : GNU make的特点...............................................................................................142
11 GNU make的一些特点.................................................................................................142
11.1 源自System v的特点...................................................................................................142
11.2 源自其他版本的特点....................................................................................................143
11.3 GNU make自身的特点.................................................................................................143
第十二章 和其它版本的兼容....................................................................................................144
12 不兼容性......................................................................................................................144
第十三章 Makefile的约定........................................................................................................146
13 书写约定......................................................................................................................146
13.1 基本的约定...................................................................................................................146
13.2 规则命令行的约定........................................................................................................147
13.3 代表命令变量...............................................................................................................149
13.4 安装目录变量...............................................................................................................150
13.5 Makefile的标准目标名.................................................................................................154
13.6 安装命令分类...............................................................................................................159
第十四章 make的常见错误信息...............................................................................................161
14 make产生的错误信息..........................................................................................................161
附录1:关键字索引.................................................................................................................163
GNU make可识别的指示符:..............................................................................................163
GNU make函数:...............................................................................................................164
GNU make的自动化变量.....................................................................................................165
GNU make环境变量............................................................................................................166
后序.........................................................................................................................................166

 

 

下载地址去我的上传资源里找即可,这里没有添加附件的功能。

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:50692次
    • 积分:758
    • 等级:
    • 排名:千里之外
    • 原创:24篇
    • 转载:12篇
    • 译文:0篇
    • 评论:17条
    最新评论