GNU make
中文手册
8.1 函数的调用语法............................................................................................................ 109
8.2 文本处理函数 ............................................................................................................... 110
8.2.1 $(subst FROM,TO,TEXT) ..................................................................................... 110
8.2.2 $(patsubst PATTERN,REPLACEMENT,TEXT) ................................................... 110
8.2.3 $(strip STRINT)..................................................................................................... 112
8.2.4 $(findstring FIND,IN)............................................................................................ 112
8.2.5 $(filter PATTERN…,TEXT)................................................................................... 112
8.2.6 $(filter-out PATTERN...,TEXT)............................................................................. 113
8.2.7 $(sort LIST)........................................................................................................... 113
8.2.8 $(word N,TEXT) .................................................................................................... 114
8.2.9 $(wordlist S,E,TEXT)............................................................................................ 114
8.2.10 $(words TEXT) ............................................................................................ 114
8.2.11 $(firstword NAMES…) ................................................................................ 115
8.3 文件名处理函数............................................................................................................ 115
8.3.1 $(dir NAMES…) .................................................................................................... 115
8.3.2 $(notdir NAMES…)............................................................................................... 116
8.3.3 $(suffix NAMES…) ............................................................................................... 116
8.3.4 $(basename NAMES…) ....................................................................................... 117
8.3.5 $(addsuffix SUFFIX,NAMES…) ........................................................................... 117
8.3.6 $(addprefix PREFIX,NAMES…)........................................................................... 118
8.3.7 $(join LIST1,LIST2)............................................................................................... 118
8.3.8 $(wildcard PATTERN).......................................................................................... 119
8.4 foreach 函数................................................................................................................ 119
8.5 if 函数.......................................................................................................................... 120
8.6 call函数 ........................................................................................................................ 121
8.7 value函数..................................................................................................................... 123
8.8 eval函数....................................................................................................................... 124
8.9 origin函数..................................................................................................................... 125
8.10 shell函数 ...................................................................................................................... 127
8.11 make的控制函数.......................................................................................................... 128
8.11.1 $(error TEXT…)........................................................................................... 128
8.11.2 $(warning TEXT…)...................................................................................... 129
第九章:执行make .................................................................................................................. 130
9 执行make .......................................................................................................................... 130
9.1 指定makefile文件......................................................................................................... 130
9.2 指定终极目标 ............................................................................................................... 131
9.3 替代命令的执行............................................................................................................ 133
9.4 防止特定文件重建........................................................................................................ 135
9.5 替换变量定义 ............................................................................................................... 136
9.6 使用make进行编译测试 ............................................................................................... 137
9.7 Tmake的命令行选项 .................................................................................................... 138
第十章:make的隐含规则........................................................................................................ 143
10 使用隐含规则 ............................................................................................................... 143
10.1 隐含规则的使用............................................................................................................ 143
10.2 make的隐含规则一览................................................................................................... 145
10.3 隐含变量 ...................................................................................................................... 148
10.3.1 代表命令的变量 ............................................................................................ 149
10.3.2 命令参数的变量 ............................................................................................ 150
10.4 make隐含规则链.......................................................................................................... 151
10.5 模式规则 ...................................................................................................................... 153
10.5.1 模式规则介绍 ................................................................................................ 153
10.5.2 模式规则示例 ................................................................................................ 155
10.5.3 自动化变量.................................................................................................... 156
2004年9月11日
4