📄 make-10.html
字号:
<span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; color: #222222">
<hr size="1" width="100%" align="center">
<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; color: black">
在</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">Makefile</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">中重建一类目标的标准规则在很多场合需要用到。例如:根据</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">.c</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">源文件创建对应的</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">.o</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">文件,传统方式是使用</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">GNU
</span>
<span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">
的</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">C</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">编译器。</span></p>
<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; color: black">
“隐含规则”为</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">make</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">提供了重建一类目标文件通用方法,不需要在</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">Makefile</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">中明确地给出重建特定目标文件所需要的细节描述。例如:典型地;</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">make</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">对</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">C</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">文件的编译过程是由</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">.c</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">源文件编译生成</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">.o</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">目标文件。当</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">Makefile</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">中出现一个</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">.o</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">文件目标时,</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">make</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">会使用这个通用的方式将后缀为</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">.c</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">的文件编译称为目标的</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">.o</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">文件。</span></p>
<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; color: black">
另外,在</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">make</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">执行时根据需要也可能是用多个隐含规则。比如:</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">make</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">将从一个</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">.y</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">文件生成对应的</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">.c</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">文件,最后再生成最终的</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">.o</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">文件。就是说,只要目标文件名中除后缀以外其它部分相同,</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">make</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">都能够使用若干个隐含规则来最终产生这个目标文件(当然最原始的那个文件必须存在)。例如;可以在</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">Makefile</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">中这样来实现一个规则:“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">foo
: foo.h</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”,只要在当前目录下存在“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">foo.c</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”这个文件,就可以生成“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">foo</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”可执行文件。本文前边的很多例子中已经使用到了隐含规则。</span></p>
<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; color: black">
内嵌的“隐含规则”在其所定义的命令行中,会使用到一些变量(通常也是内嵌变量)。我们可以通过改变这些变量的值来控制隐含规则命令的执行情况。例如:内嵌变量“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">CFLAGS</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”代表了</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">gcc</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">编译器编译源文件的编译选项,我们就可以在</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">Makefile</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">中重新定义它,来改变编译源文件所要使用的参数。</span></p>
<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; color: black">
尽管我们不能改变</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">make</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">内嵌的隐含规则,但是我们可以使用模式规则重新定义自己的隐含规则,也可以使用后追规则来重新定义隐含规则。后缀规则存在某些限制(目前版本</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">make</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">保存它的原因是为了兼容以前版本)。使用模式规则更加清晰明了。</span></p>
</span>
<h2><a name="_gnu_make_10.1"><span style="font-size: 14pt" lang="en-us"><b>1</b></span><span lang="EN-US" style="font-size: 14.0pt"><b>0.1 </b></span><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; color: black">
使用</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">make</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">内嵌的隐含规则,在</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">Makefile</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">中就不需要明确给出重建某一个目标的命令,甚至可以不需要规则。</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">make</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">会自动根据已存在(或者可以被创建)的源文件类型来启动相应的隐含规则。例如:</span></p>
<p class="MsoNormal" style="text-indent: 20.5pt">
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial"> </span></p>
<p class="MsoNormal" style="text-indent: 41.2pt"><b><i>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial">foo : foo.o
bar.o</span></i></b></p>
<p class="MsoNormal" style="text-indent: 41.2pt; margin-left: 30.9pt"><b><i>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial">cc -o foo foo.o
bar.o $(CFLAGS) $(LDFLAGS)</span></i></b></p>
<p class="MsoNormal" style="text-indent: 20.5pt">
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial"> </span></p>
<p class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph; line-height: 150%; text-autospace: ideograph-numeric ideograph-other">
<span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">
这里并没有给出重建文件“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">foo.o</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”的规则,</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">make</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">执行这条规则时,无论文件“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">foo.o</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”存在与否,都会试图根据隐含规则来重建这个文件(就是试图重新编译文件“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">foo.c</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”或者其它类型的源文件)。</span></p>
<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 lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">
make</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">执行过程中找到的隐含规则,提供了此目标的基本依赖关系,确定了目标的依赖文件(通常是源文件,不包含对应的头文件依赖)和重建目标需要使用的命令行。隐含规则所提供的依赖文件只是一个最基本的(通常它们之间的对应关系为:“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">EXENAME.o</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”对应“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">EXENAME.c</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”、“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">EXENAME</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”对应于“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">EXENAME.o</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”)。当需要增加这个目标的依赖文件时,要在</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">Makefile</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">中使用没有命令行的规则给出。</span></p>
<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; color: black">
每一个内嵌的隐含规则中都存在一个目标模式和依赖模式,而且同一个目标模式可以对应多个依赖模式。例如:一个</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">.o</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">文件的目标可以由</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">c</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">编译器编译对应的</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">.c</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">源文件得到、</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">Pascal</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">编译器编译</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">.p</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">的源文件得到,等等。</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">make</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">会根据不同的源文件来使用不同的编译器。对于“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">foo.c</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”就是用</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">c</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">编译,对于“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">foo.p</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”就使用</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">Pascal</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">编译器编译。</span></p>
<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; color: black">
上边提到,</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">make</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">会自动根据已存在(或者可以被创建)的源文件类型来启动相应的隐含规则。这里的“可被创建”文件是指:这个文件在</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">Makefile</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">中被作为目标或者依赖明确的提及,或者可以根据已存在的文件使用其它的隐含规则来创建它。当一个隐含规则的目标是另外一个隐含规则的依赖时,我们称它们是一个隐含规则链。</span></p>
<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; color: black">
通常,</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">make</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">会对那些没有命令行的规则、</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black"><span lang="EN-US" style="font-family: 楷体_GB2312">双冒号规则</span></span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">寻找一个隐含规则来执行。作为一个规则的依赖文件,在没有一个规则明确描述它的依赖关系的情况下;</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">make</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">会将其作为一个目标并为它搜索一个隐含规则,试图重建它。</span></p>
<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; color: black">
注意:给目标文件指定明确的依赖文件并不会影响隐含规则的搜索。我们来看一个例子:</span></p>
<p class="MsoNormal" style="text-indent: 20.5pt">
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial"> </span></p>
<p class="MsoNormal" style="text-indent: 41.2pt"><b><i>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial">foo.o: foo.p</span></i></b></p>
<p class="MsoNormal" style="text-indent: 20.5pt">
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial"> </span></p>
<p class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph; line-height: 150%; text-autospace: ideograph-numeric ideograph-other">
<span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">
这个规则指定了“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">foo</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”的依赖文件是“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">foo.p</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”。但是如果在工作目录下存在同名</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">.c</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">源文件“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">foo.c</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”。执行</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">make</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">的结果就不是用“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">pc</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”编译“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">foo.p</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”来生成“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">foo</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”,而是用“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">cc</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”编译“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">foo.c</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”来生成目标文件。这是因为在隐含规则列表中对</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">.c</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">文件的隐含规则处于</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">.p</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">文件隐含规则之前。</span></p>
<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; color: black">
当需要给目标指定明确的重建规则时,规则描述中就不能省略命令行,这个规则必须提供明确的重建命令来说明目标需要重建所需要的动作。为了能够在存在“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">foo.c</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”的情况下编译“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">foo.p</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”。规则可以这样写:</span></p>
<p class="MsoNormal" style="text-indent: 20.5pt">
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial"> </span></p>
<p class="MsoNormal" style="text-indent: 41.2pt"><b><i>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial">foo.o: foo.p</span></i></b></p>
<p class="MsoNormal" style="text-indent: 41.2pt; margin-left: 30.9pt"><b><i>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial">pc $< -o $@</span></i></b></p>
<p class="MsoNormal" style="text-indent: 20.5pt">
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial"> </span></p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -