📄 make-07.html
字号:
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial">ifeq ($(CC),gcc)</span></i></b></p>
<p class="MsoNormal" style="text-indent: 13.85pt; margin-left: 29.95pt"><b><i>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial">libs=$(libs_for_gcc)</span></i></b></p>
<p class="MsoNormal" style="text-indent: 13.85pt; margin-left: 29.95pt"><b><i>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial">else</span></i></b></p>
<p class="MsoNormal" style="text-indent: 13.85pt; margin-left: 29.95pt"><b><i>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial">libs=$(normal_libs)</span></i></b></p>
<p class="MsoNormal" style="text-indent: 13.85pt; margin-left: 29.95pt"><b><i>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial">endif</span></i></b></p>
<p class="MsoNormal" style="text-indent: 13.85pt; margin-left: 29.95pt"><b><i>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial"> </span></i></b></p>
<p class="MsoNormal" style="text-indent: 13.85pt; margin-left: 29.95pt"><b><i>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial">foo: $(objects)</span></i></b></p>
<p class="MsoNormal" style="text-indent: 13.85pt; margin-left: 58.2pt"><b><i>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial">$(CC) -o foo
$(objects) $(libs)</span></i></b></p>
<h2><a name="_gnu_make_7.2"><span style="font-size: 14pt" lang="en-us"><b>7</b></span><b><span lang="EN-US" style="font-size: 14.0pt">.2<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">
</span></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; color: black">
一个简单的不包含“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">else</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”分支的条件判断语句的语法格式为:</span></p>
<p class="MsoNormal" style="text-indent: 13.85pt; margin-left: 29.95pt"><b><i>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial">
CONDITIONAL-DIRECTIVE</span></i></b></p>
<p class="MsoNormal" style="text-indent: 13.85pt; margin-left: 29.95pt"><b><i>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial">TEXT-IF-TRUE</span></i></b></p>
<p class="MsoNormal" style="text-indent: 13.85pt; margin-left: 29.95pt"><b><i>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial">endif</span></i></b></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">TEXT-IF-TRUE</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><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">else</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”的复杂一点的语法格式为:</span></p>
<p class="MsoNormal" style="text-indent: 13.85pt; margin-left: 29.95pt"><b><i>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial">
CONDITIONAL-DIRECTIVE</span></i></b></p>
<p class="MsoNormal" style="text-indent: 13.85pt; margin-left: 29.95pt"><b><i>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial">TEXT-IF-TRUE</span></i></b></p>
<p class="MsoNormal" style="text-indent: 13.85pt; margin-left: 29.95pt"><b><i>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial">else</span></i></b></p>
<p class="MsoNormal" style="text-indent: 13.85pt; margin-left: 29.95pt"><b><i>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial">TEXT-IF-FALSE</span></i></b></p>
<p class="MsoNormal" style="text-indent: 13.85pt; margin-left: 29.95pt"><b><i>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial">endif</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">TEXT-IF-TRUE</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">TEXT-IF-FALSE</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">TEXT-IF-TRUE</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">TEXT-IF-FALSE</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">CONDITIONAL-DIRECTIVE</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”对于上边的两种格式都是同样的。可以是以下四种用于测试不同条件的关键字。</span></p>
<h3><a name="_gnu_make_7.2.1"><span lang="en-us">7</span><span lang="EN-US">.2.1<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">
</span></span><span style="font-family: 黑体">关键字“</span><span lang="EN-US">ifeq</span><span style="font-family: 黑体">”</span></a></h3>
<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.6pt"><b>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial; color: blue">`ifeq
(ARG1, ARG2)'</span></b></p>
<p class="MsoNormal" style="text-indent: 20.6pt"><b>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial; color: blue">`ifeq
'ARG1' 'ARG2''</span></b></p>
<p class="MsoNormal" style="text-indent: 20.6pt"><b>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial; color: blue">`ifeq
"ARG1" "ARG2"'</span></b></p>
<p class="MsoNormal" style="text-indent: 20.6pt"><b>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial; color: blue">`ifeq
"ARG1" 'ARG2''</span></b></p>
<p class="MsoNormal" style="text-indent: 20.6pt"><b>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial; color: blue">`ifeq
'ARG1' "ARG2"'</span></b></p>
<p class="MsoNormal" style="text-indent: 20.5pt">
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial; 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">ARG1</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">ARG1</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">TEXT-IF-TRUE</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">TEXT-IF-FALSE</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">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -