找传奇、传世资源到传世资源站!

Gun make中文手册.pdf

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

Gun make中文手册.pdf Linux内核编程-第1张Gun make中文手册.pdf Linux内核编程-第2张Gun make中文手册.pdf Linux内核编程-第3张Gun make中文手册.pdf Linux内核编程-第4张Gun make中文手册.pdf Linux内核编程-第5张目 录Table of ContentsGNU make中文手册..................................................................................................................... 1ver - 3.8 ....................................................................................................................................... 1第一章:概述 ............................................................................................................................... 71.1 概述 ................................................................................................................................. 71.2 准备知识 .......................................................................................................................... 8第二章 GNU make 介绍 ............................................................................................................. 92 GNU make 介绍.................................................................................................................... 92.1 Makefile简介.................................................................................................................. 102.2 Makefile规则介绍........................................................................................................... 112.3 简单的示例..................................................................................................................... 122.4 make如何工作 ............................................................................................................... 132.5 指定变量 ........................................................................................................................ 152.6 自动推导规则................................................................................................................. 162.7 另类风格的makefile ....................................................................................................... 172.8 清除工作目录过程文件................................................................................................... 18第三章:Makefile 总述.............................................................................................................. 203 Makefile总述........................................................................................................................ 203.1 Makefile的内容............................................................................................................... 203.2 makefile文件的命名 ....................................................................................................... 213.3 包含其它makefile文件.................................................................................................... 223.4 变量 MAKEFILES.......................................................................................................... 243.5 变量 MAKEFILE_LIST .................................................................................................. 263.6 其他特殊变量................................................................................................................. 263.7 makefile文件的重建 ....................................................................................................... 273.8 重载另外一个makefile.................................................................................................... 283.9 make如何解析makefile文件........................................................................................... 303.9.1 变量取值 .................................................................................................................. 303.9.2 条件语句 .................................................................................................................. 313.9.3 规则的定义............................................................................................................... 313.10 总结 ............................................................................................................................... 31第四章:Makefile的规则 ............................................................................................................ 334 Makefile规则........................................................................................................................ 334.1 一个例子 ........................................................................................................................ 334.2 规则语法 ........................................................................................................................ 344.3 依赖的类型..................................................................................................................... 354.4 文件名使用通配符.......................................................................................................... 364.4.1 统配符使用举例........................................................................................................ 374.4.2 通配符存在的缺陷 .................................................................................................... 384.4.3 函数wildcard ............................................................................................................ 384.5 目录搜寻 ........................................................................................................................ 394.5.1 一般搜索(变量VPATH)........................................................................................ 394.5.2 选择性搜索(关键字vpath) .................................................................................... 404.5.3 目录搜索的机制........................................................................................................ 414.5.4 命令行和搜索目录 .................................................................................................... 444.5.5 隐含规则和搜索目录................................................................................................. 444.5.6 库文件和搜索目录 .................................................................................................... 452004年9月11日 2GNU make中文手册4.6 Makefile伪目标............................................................................................................... 464.7 强制目标(没有命令或依赖的规则) ............................................................................. 504.8 空目标文件..................................................................................................................... 504.9 Makefile的特殊目标 ....................................................................................................... 514.10 多目标............................................................................................................................ 544.11 多规则目标..................................................................................................................... 554.12 静态模式 ........................................................................................................................ 564.12.1 静态模式规则的语法 ....................................................................................... 564.12.2 静态模式和隐含规则 ....................................................................................... 584.13 双冒号规则..................................................................................................................... 594.14 自动产生依赖................................................................................................................. 60第五章:规则的命令 .................................................................................................................. 635 为规则书写命令 ................................................................................................................... 635.1 命令回显 ........................................................................................................................ 635.2 命令的执行..................................................................................................................... 645.3 并发执行命令................................................................................................................. 655.4 命令执行的错误.............................................................................................................. 675.5 中断make的执行............................................................................................................ 685.6 make的递归执行............................................................................................................ 695.6.1 变量MAKE ............................................................................................................... 705.6.2 变量和递归............................................................................................................... 715.6.3 命令行选项和递归 .................................................................................................... 755.6.4 -w选项...................................................................................................................... 775.7 定义命令包..................................................................................................................... 785.8 空命令............................................................................................................................ 80第六章:Makefile中的变量......................................................................................................... 816 使用变量.............................................................................................................................. 816.1 变量的引用..................................................................................................................... 826.2 两种变量定义(赋值)................................................................................................... 836.2.1 递归展开式变量........................................................................................................ 836.2.2 直接展开式变量........................................................................................................ 856.2.3 定义一个空格 ........................................................................................................... 866.2.4 “?=”操作符............................................................................................................. 876.3 变量的高级用法.............................................................................................................. 886.3.1 变量的替换引用........................................................................................................ 886.3.2 变量的套嵌引用........................................................................................................ 886.4 变量取值 ........................................................................................................................ 926.5 如何设置变量................................................................................................................. 936.6 追加变量值..................................................................................................................... 946.7 override 指示符............................................................................................................. 966.8 多行定义 ........................................................................................................................ 986.9 系统环境变量................................................................................................................. 996.10 目标指定变量............................................................................................................... 1016.11 模式指定变量............................................................................................................... 103第七章:Makefile的条件执行 ................................................................................................... 1047 Makefile的条件判断 ........................................................................................................... 1047.1 一个例子 ...................................................................................................................... 1047.2 条件判断的基本语法 .................................................................................................... 1057.3 标记测试的条件语句 .................................................................................................... 108第八章:make的内嵌函数........................................................................................................ 1098 make的函数....................................................................................................................... 1092004年9月11日 3GNU make中文手册8.1 函数的调用语法............................................................................................................ 1098.2 文本处理函数............................................................................................................... 1108.2.1 $(subst FROM,TO,TEXT) ..................................................................................... 1108.2.2 $(patsubst PATTERN,REPLACEMENT,TEXT) ................................................... 1108.2.3 $(strip STRINT)..................................................................................................... 1128.2.4 $(findstring FIND,IN)............................................................................................ 1128.2.5 $(filter PATTERN…,TEXT)................................................................................... 1128.2.6 $(filter-out PATTERN...,TEXT)............................................................................. 1138.2.7 $(sort LIST)........................................................................................................... 1138.2.8 $(word N,TEXT) .................................................................................................... 1148.2.9 $(wordlist S,E,TEXT)............................................................................................ 1148.2.10 $(words TEXT) ............................................................................................ 1148.2.11 $(firstword NAMES…) ................................................................................ 1158.3 文件名处理函数............................................................................................................ 1158.3.1 $(dir NAMES…) .................................................................................................... 1158.3.2 $(notdir NAMES…)............................................................................................... 1168.3.3 $(suffix NAMES…) ............................................................................................... 1168.3.4 $(basename NAMES…) ....................................................................................... 1178.3.5 $(addsuffix SUFFIX,NAMES…) ........................................................................... 1178.3.6 $(addprefix PREFIX,NAMES…)........................................................................... 1188.3.7 $(join LIST1,LIST2)............................................................................................... 1188.3.8 $(wildcard PATTERN).......................................................................................... 1198.4 foreach 函数................................................................................................................ 1198.5 if 函数.......................................................................................................................... 1208.6 call函数........................................................................................................................ 1218.7 value函数..................................................................................................................... 1238.8 eval函数....................................................................................................................... 1248.9 origin函数..................................................................................................................... 1258.10 shell函数...................................................................................................................... 1278.11 make的控制函数.......................................................................................................... 1288.11.1 $(error TEXT…)........................................................................................... 1288.11.2 $(warning TEXT…)...................................................................................... 129第九章:执行make .................................................................................................................. 1309 执行make .......................................................................................................................... 1309.1 指定makefile文件......................................................................................................... 1309.2 指定终极目标............................................................................................................... 1319.3 替代命令的执行............................................................................................................ 1339.4 防止特定文件重建........................................................................................................ 1359.5 替换变量定义............................................................................................................... 1369.6 使用make进行编译测试 ............................................................................................... 1379.7 Tmake的命令行选项 .................................................................................................... 138第十章:make的隐含规则........................................................................................................ 14310 使用隐含规则............................................................................................................... 14310.1 隐含规则的使用............................................................................................................ 14310.2 make的隐含规则一览................................................................................................... 14510.3 隐含变量 ...................................................................................................................... 14810.3.1 代表命令的变量 ............................................................................................ 14910.3.2 命令参数的变量 ............................................................................................ 15010.4 make隐含规则链.......................................................................................................... 15110.5 模式规则 ...................................................................................................................... 15310.5.1 模式规则介绍................................................................................................ 15310.5.2 模式规则示例................................................................................................ 15510.5.3 自动化变量.................................................................................................... 1562004年9月11日 4GNU make中文手册T10.5.4 T模式的匹配 ................................................................................................. 15910.5.5 万用规则 ....................................................................................................... 16010.5.6 重建内嵌隐含规则......................................................................................... 16110.6 缺省规则 ...................................................................................................................... 16210.7 后缀规则 ...................................................................................................................... 16210.8 隐含规则搜索算法........................................................................................................ 164第十一章:使用make更新静态库文件...................................................................................... 16611 更新静态库文件............................................................................................................ 16611.1 库成员作为目标............................................................................................................ 16611.2 静态库的更新............................................................................................................... 16711.2.1 更新静态库的符号索引表 .............................................................................. 16811.3 make静态库的注意事项 ............................................................................................... 16811.4 静态库的后缀规则........................................................................................................ 169第十二章 : GNU make的特点............................................................................................... 17012 GNU make的一些特点................................................................................................. 17012.1 源自System v的特点.................................................................................................... 17012.2 源自其他版本的特点 .................................................................................................... 17112.3 GNU make自身的特点................................................................................................. 172第十三章 和其它版本的兼容.................................................................................................... 17413 不兼容性 ...................................................................................................................... 174第十四章 Makefile的约定 ........................................................................................................ 17614 书写约定 ...................................................................................................................... 17614.1 基本的约定................................................................................................................... 17614.2 规则命令行的约定........................................................................................................ 17814.3 代表命令变量............................................................................................................... 17914.4 安装目录变量............................................................................................................... 18014.5 Makefile的标准目标名.................................................................................................. 18514.6 安装命令分类............................................................................................................... 190第十五章 make的常见错误信息............................................................................................... 19315 make产生的错误信息................................................................................................... 193附录1:关键字索引.................................................................................................................. 196GNU make可识别的指示符:.............................................................................................. 196GNU make函数: ............................................................................................................... 197GNU make的自动化变量..................................................................................................... 197GNU make环境变量............................................................................................................ 198后序 ......................................................................................................................................... 198

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复