继续翻译

`ifndef VARIABLE-NAME'
     If the variable VARIABLE-NAME has an empty value, the TEXT-IF-TRUEis effective; otherwise, the TEXT-IF-FALSE, if any, is effective.The rules for expansion and testing of VARIABLE-NAME are identicalto the `ifdef' directive.
Extra spaces are allowed and ignored at the beginning of the
conditional directive line, but a tab is not allowed.  (If the line
begins with a tab, it will be considered part of a recipe for a rule.)
Aside from this, extra spaces or tabs may be inserted with no effect
anywhere except within the directive name or within an argument.  A
comment starting with `#' may appear at the end of the line.
The other two directives that play a part in a conditional are `else'
and `endif'.  Each of these directives is written as one word, with no
arguments.  Extra spaces are allowed and ignored at the beginning of the
line, and spaces or tabs at the end.  A comment starting with `#' may
appear at the end of the line.Conditionals affect which lines of the makefile `make' uses.  If the
condition is true, `make' reads the lines of the TEXT-IF-TRUE as part
of the makefile; if the condition is false, `make' ignores those lines
completely.  It follows that syntactic units of the makefile, such as
rules, may safely be split across the beginning or the end of the
conditional.`make' evaluates conditionals when it reads a makefile.
Consequently, you cannot use automatic variables in the tests of
conditionals because they are not defined until recipes are run (*note
Automatic Variables::).To prevent intolerable confusion, it is not permitted to start a
conditional in one makefile and end it in another.  However, you may
write an `include' directive within a conditional, provided you do not
attempt to terminate the conditional inside the included file.

`ifndef VARIABLE-NAME'

如果变量 VARIABLE-NAME 有一个空的值,那么 TEXT-IF-TRUE 是有效的;否则,如果存在TEXT-IF-FALSE, 则 TEXT-IF-FALSE 是有效的。对变量 VARAIBLE-NAME 的扩展和测试与 ifdef 指令中的相同。

在条件式指令行的开始处允许有额外的空格,这些空格将被忽略,但是tab符号是不被允许的(如果一行开始与tab符号,那么它将被认为是规则的片段的一部分。)。此外,额外的空格或者tab符号可以插入到其他任何地方并被忽略,但是不能在指令名字里或者参数里面。以#开头的注释可以被放入一行的末尾。

另外两个在条件式中起到作用的指令else 和 endif 。这些指令的每一个都是写作一个单词,没有参数。在行首的额外空格被允许而且会被忽略,末尾的空格和tab符号也是如此。开始于#的注释会出现在行的末尾。

条件式影响到哪些行会被make所使用。如果条件为真,make 读取 TEXT-IF-TRUE 为makefile的部分;如果条件为假,make 完全忽略那些行。它遵循makefile的语法规则,如规则的语法规则,规则可以跨越条件式的开始或结束。

make 读取一个makefile的时候,要评估条件式,因此你不能在测试条件式的时候使用自动变量因为在片段没有运行的时候它们还没有定义呢(*note Automatic Variables::)。

为了防止难堪的困惑,不允许在一个makefile中开始一个条件式却在另一个makefile中结束之。但是你可以在一个条件式中写一个 include 指令,此时你不能试图在包含的文件中结束条件式。

后文待续

转载于:https://www.cnblogs.com/gaojian/archive/2012/10/09/2716078.html

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

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

    继续翻译 The syntax of the CONDITIONAL-DIRECTIVE is the same whether the conditional is simple or comple ...

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

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

  3. GNU make manual 翻译( 一百六十三)

    继续翻译 6.6 Appending More Text to Variables ====================================Often it is useful to ...

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

    继续翻译 `.ONESHELL' If `.ONESHELL' is mentioned as a target, then when a target is built all lines of t ...

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

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

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

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

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

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

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

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

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

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

最新文章

  1. 洛谷 P1330 封锁阳光大学 Label:染色问题
  2. OSError: [WinError 6] 句柄无效
  3. ASP.NET中常用的26个优化性能方法
  4. 系统调用回答为什么要用buffer写
  5. 发现保存GIF格式后相素发生变化咋办
  6. Oracle官方推荐的性能测试工具!简单、精准又直观!
  7. pycharm使用心得
  8. 利用cookie爬取QQ邮箱的python脚本
  9. JQuery选择器跨frame和层次选择
  10. spring学习--完全注解开发(不需要xml)
  11. vnc支持用计算机民远程吗,VNC远程控制软件是什么?有没有更好的远程桌面控制解决方案?...
  12. 荐书一本-----《天才在左,疯子在右》
  13. 软件测试教程第2版(宫云战主编)
  14. S@Kura的PHP进阶之路(二)
  15. 江苏开启“金环”对话会:政府“牵线”助环保项目与金融“联姻”
  16. SpringCloud_Dubbo_JZZ_MBY
  17. 通过azure学生认证拿到一年服务器使用权
  18. Windows Server 2012 VDI 部署的前提条件
  19. MySQL 自定义stuff函数
  20. 张艾迪(创始人):艾迪的学校与成长故事

热门文章

  1. Tensorflow【实战Google深度学习框架】TFLearn大宝剑
  2. python 判断字母大小写
  3. log4j中调试与错误日志分开_idea中log4j日志插件报错
  4. intel 核显linux驱动程序,10nm来也!Intel 11代核显Linux驱动功能冻结
  5. oracle10grac创建单实例,Oracle10gLinux单实例迁移到rac
  6. java byte 正数最大_为什么Java byte 类型的取值范围是-128~127
  7. mysql服务在tcp6_为什么 netstat 对某些服务只显示了 tcp6 监听端口
  8. 前端测试 jest 中判断函数由来
  9. 浅析企业网站建设的基本费用组成
  10. project 模板_18个施工进度计划横道图模板,自动出图超方便,全部在这儿给你准好了...