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