继续翻译

   The syntax of the CONDITIONAL-DIRECTIVE is the same whether the
conditional is simple or complex; after an `else' or not.  There are
four different directives that test different conditions.  Here is a
table of them:`ifeq (ARG1, ARG2)'
`ifeq 'ARG1' 'ARG2''
`ifeq "ARG1" "ARG2"'
`ifeq "ARG1" 'ARG2''
`ifeq 'ARG1' "ARG2"'
     Expand all variable references in ARG1 and ARG2 and compare them.If they are identical, the TEXT-IF-TRUE is effective; otherwise,the TEXT-IF-FALSE, if any, is effective.Often you want to test if a variable has a non-empty value.  Whenthe value results from complex expansions of variables andfunctions, expansions you would consider empty may actuallycontain whitespace characters and thus are not seen as empty.However, you can use the `strip' function (*note Text Functions::)to avoid interpreting whitespace as a non-empty value.  Forexample:ifeq ($(strip $(foo)),)TEXT-IF-EMPTYendifwill evaluate TEXT-IF-EMPTY even if the expansion of `$(foo)'
     contains whitespace characters.`ifneq (ARG1, ARG2)'
`ifneq 'ARG1' 'ARG2''
`ifneq "ARG1" "ARG2"'
`ifneq "ARG1" 'ARG2''
`ifneq 'ARG1' "ARG2"'
     Expand all variable references in ARG1 and ARG2 and compare them.If they are different, the TEXT-IF-TRUE is effective; otherwise,the TEXT-IF-FALSE, if any, is effective.

对条件式指令的语法而言,无论条件是简单还是复杂,是否在else之后或不适,语法都是相同的。测试不同的条件,可以由四种不同的指令。下面是一个列表:

`ifeq (ARG1, ARG2)'
`ifeq 'ARG1' 'ARG2''
`ifeq "ARG1" "ARG2"'
`ifeq "ARG1" 'ARG2''
`ifeq 'ARG1' "ARG2"'

扩展在ARG1 和 ARG2中所有的变量参照。如果它们是相同的,那么 TEXT-IF-TRUE 生效;否则 如果有TEXT-IF-FALSE, 则 TEXT-IF-FALSE 生效。

经常性地,你可能想要测试是否一个变量是非空值。当一个值来自于复杂的变量扩展或者函数,那么你认为的因当时空的扩展,很可能实际上包含的空格字符,此时不能被认为是空。但是你可以用 strip函数(*note Text Function::)来防止把空格字符翻译为非空值。例如:

ifeq ($(strip $(foo)),)
TEXT-IF-EMPTY
endif

即使$(foo)包含了空格字符,也会获得 TEXT-IF-EMPTY 。

`ifneq (ARG1, ARG2)'
`ifneq 'ARG1' 'ARG2''
`ifneq "ARG1" "ARG2"'
`ifneq "ARG1" 'ARG2''
`ifneq 'ARG1' "ARG2"'
Expand all variable references in ARG1 and ARG2 and compare them.
If they are different, the TEXT-IF-TRUE is effective; otherwise,
the TEXT-IF-FALSE, if any, is effective.

扩展ARG1和ARG2中所有的变量参照并比较它们。如果不同则TEXT-IF-TRUE有效。否则,若TEXT-IF-FALSE存在,则 TEXT-IF-FALSE有效。

后文待续

GNU make manual 翻译( 一百八十一)相关推荐

  1. GNU make manual 翻译( 一百二十一)

    继续翻译 4.13 Double-Colon Rules =======================Double-colon rules are explicit rules written wi ...

  2. GNU make manual 翻译( 一百八十三)

    继续翻译 `ifndef VARIABLE-NAME' If the variable VARIABLE-NAME has an empty value, the TEXT-IF-TRUEis eff ...

  3. GNU make manual 翻译( 一百八十二)

    继续翻译 `ifdef VARIABLE-NAME' The `ifdef' form takes the _name_ of a variable as its argument, not a re ...

  4. GNU make manual 翻译( 一百五十五)

    继续翻译 6.2 The Two Flavors of Variables ================================There are two ways that a vari ...

  5. GNU make manual 翻译( 一百二十四)

    继续翻译 Note that such a prerequisite constitutes mentioning `main.o' in a makefile, so it can never be ...

  6. GNU make manual 翻译( 一百五十四)

    继续翻译 6.1 Basics of Variable References =================================To substitute a variable's v ...

  7. GNU make manual 翻译( 一百零九)

    继续翻译 `.LOW_RESOLUTION_TIME' If you specify prerequisites for `.LOW_RESOLUTION_TIME', `make' assumes ...

  8. GNU make manual 翻译( 一百五十九)

    继续翻译 A computed variable name need not consist entirely of a single variable reference. It can conta ...

  9. GNU make manual 翻译( 一百七十五)

    继续翻译 `.DEFAULT_GOAL' Sets the default goal to be used if no targets were specified onthe command lin ...

最新文章

  1. seaborn使用violinplot函数可视化分组小提琴图(Grouped Violinplot with Seaborn violinplot)并保存可视化结果
  2. linux非lvm分区在线扩容,怎么给不是LVM的根分区扩容
  3. linux php 指令,在 Linux 命令行中使用和执行 PHP 代码(一)
  4. SCO UNIXWARE 文件系统损坏,后恢复数据成功
  5. STM32开发 -- 系统软复位
  6. Get value from agent failed: cannot connect to [[192.168.186.130]:10050]: [113]No route to host
  7. Unity3D 之武器系统冷却功能的实现方式
  8. Atitit 文件存储标准化api 总结 目录 1. 操作系统,进行操作 1 1.1. FileUtils类的应用 1 1.2. 各大api 比较 2 2. Java。Io用apache的commo
  9. 计算机视觉方向大创题目,关于开展2020年大创项目学生选题或自拟题目申报工作的通知...
  10. Xcode 使用手册之01 欢迎使用Xcode(Xcode中文文档手册)
  11. 【WINDOWS / DOS 批处理】添加注释
  12. 实践三 网络嗅探与协议分析
  13. 如何安装 Simscape Multibody Link
  14. 【往届期末试卷】2018届数据库原理与应用
  15. 什么是爱情——碧海青天BBS
  16. Qt成功运行Zynq UltraScale+MPSoC平台上
  17. px、em、rem单位间的区别
  18. 入职8年程序员被怼!网友:不懂业务,滚犊子!
  19. 一招教你如何大批量解密pdf
  20. Python + Selenium WebDriver

热门文章

  1. OpenCV新手入门,如何用它平移缩放和旋转图片
  2. 首家A股云计算公司背后:黑客大神创办,2019上半年净利润下跌84%
  3. 0040-如何重置Cloudera Manager的admin密码
  4. Argparse简易教程
  5. 构建gitbook并基于gitlab自动发布~
  6. macOS 10.12 Sierra 中文官网正式推出
  7. nova resize代码调用部分分析
  8. C语言运算符优先级和口诀(转)
  9. 如何让ssh登录时不提示是否要添加HostKey
  10. [zz]Ubuntu10.04源 更新源列表