⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 make-03.html

📁 unix make 文档
💻 HTML
📖 第 1 页 / 共 5 页
字号:
h3
	{margin-top:12.0pt;
	margin-right:0pt;
	margin-bottom:12.0pt;
	margin-left:36.0pt;
	text-align:justify;
	text-justify:inter-ideograph;
	text-indent:-36.0pt;
	page-break-after:avoid;
	tab-stops:list 36.0pt;
	text-autospace:none;
	font-size:12.0pt;
	font-family:Arial;
	font-weight:normal}
p.a0
	{margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	text-indent:18.0pt;
	line-height:150%;
	text-autospace:none;
	border:medium none;
	padding:0pt;
	font-size:9.0pt;
	font-family:Arial;
	margin-left:0pt; margin-right:0pt; margin-top:0pt}
-->
</style>
</head>

<body>

<h1 align="center" style="text-align: center; text-indent: 0pt; margin-left: 0pt">
<a name="chapter_03"><span style="font-size: 18.0pt; font-family: 楷体_GB2312">
第三章:</span><span lang="EN-US" style="font-size: 18.0pt">Makefile </span>
<span style="font-size: 18.0pt; font-family: 楷体_GB2312">总述</span></a></h1>
	<span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; color: #222222">
	<hr size="1" width="100%" align="center">
</span>
<h2><a name="_gnu_make_3.1"><span lang="EN-US" style="font-size: 14.0pt"><b>3.1 Makefile</b></span><b><span style="font-size: 14.0pt; font-family: 楷体_GB2312">的</span></b><span style="font-size: 14.0pt; font-family: 楷体_GB2312">内容</span></a></h2>
<p class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph; text-indent: 24.0pt; line-height: 150%; text-autospace: ideograph-numeric ideograph-other">
<span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312">
在一个完整的</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial">Makefile</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312">中,包含了</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial">5</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312">个东西:显式规则、隐含规则、变量定义、指示符和注释。关于“规则”、“变量”和“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial">Makefile</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312">指示符”将在后续的章节进行详细的讨论。本章讨论的是一些基本概念。</span></p>
<p class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph; text-indent: -21.0pt; line-height: 150%; text-autospace: ideograph-numeric ideograph-other; margin-left: 51.0pt">
<span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Wingdings">
&sup2;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span>
<span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312">
显式规则:它描述了在何种情况下如何更新一个或者多个被称为目标的文件(</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial">Makefile</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312">的目标文件)。书写</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial">Makefile</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312">时需要明确地给出目标文件、目标的依赖文件列表以及更新目标文件所需要的命令(有些规则没有命令,这样的规则只是纯粹的描述了文件之间的依赖关系)。</span></p>
<p class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph; text-indent: -21.0pt; line-height: 150%; text-autospace: ideograph-numeric ideograph-other; margin-left: 51.0pt">
<span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Wingdings">
&sup2;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span>
<span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312">
隐含规则:它是</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial">make</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312">根据一类目标文件(典型的是根据文件名的后缀)而自动推导出来的规则。</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial">make</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312">根据目标文件的名,自动产生目标的依赖文件并使用默认的命令来对目标进行更新(建立一个规则)。</span></p>
<p class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph; text-indent: -21.0pt; line-height: 150%; text-autospace: ideograph-numeric ideograph-other; margin-left: 51.0pt">
<span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Wingdings">
&sup2;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span>
<span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312">
变量定义:使用一个字符或字符串代表一段文本串,当定义了一个变量以后,</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial">Makefile</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312">后续在需要使用此文本串的地方,通过引用这个变量来实现对文本串的使用。第一章的例子中,我们就定义了一个变量“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial">objects</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312">”来表示一个</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial">.o</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312">文件列表。</span></p>
<p class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph; text-indent: -21.0pt; line-height: 150%; text-autospace: ideograph-numeric ideograph-other; margin-left: 51.0pt">
<span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Wingdings">
&sup2;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span>
<span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial">
Makefile</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312">指示符:指示符指明在</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial">make</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312">程序读取</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial">makefile</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312">文件过程中所要执行的一个动作。其中包括:</span></p>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -