zoukankan      html  css  js  c++  java
  • GNU make manual 翻译( 一百七十)

    继续翻译

    6.11 Target-specific Variable Values
    ====================================
    
    Variable values in `make' are usually global; that is, they are the
    same regardless of where they are evaluated (unless they're reset, of
    course).  One exception to that is automatic variables (*note Automatic
    Variables::).
    
       The other exception is "target-specific variable values".  This
    feature allows you to define different values for the same variable,
    based on the target that `make' is currently building.  As with
    automatic variables, these values are only available within the context
    of a target's recipe (and in other target-specific assignments).
    
       Set a target-specific variable value like this:
    
         TARGET ... : VARIABLE-ASSIGNMENT
    
       Target-specific variable assignments can be prefixed with any or all
    of the special keywords `export', `override', or `private'; these apply
    their normal behavior to this instance of the variable only.
    
       Multiple TARGET values create a target-specific variable value for
    each member of the target list individually.
    
       The VARIABLE-ASSIGNMENT can be any valid form of assignment;
    recursive (`='), static (`:='), appending (`+='), or conditional
    (`?=').  All variables that appear within the VARIABLE-ASSIGNMENT are
    evaluated within the context of the target: thus, any
    previously-defined target-specific variable values will be in effect.
    Note that this variable is actually distinct from any "global" value:
    the two variables do not have to have the same flavor (recursive vs.
    static).

    6.11 目的特定的变量值
    ====================================

    make中的变量的值通常是全局的,那就是说,它们无论在何被解析,都有相同的值(当然,除非它们被重新设定了)。一个例外是全局变量(*note Automatic Variables::)

    令一个例外是,目的特定的变量的值。这个功能允许你为同样的变量,定义不同的值,这个值基于make正在进行构建的目的。和自动变量相仿,这些值只能在目的片段的上下文中有效(或者在其他的目的特定的赋值中)。

    设置目的特定的变量的语法如下:

    TARGET ... : VARIABLE-ASSIGNMENT

    目的特定的变量赋之可以被用export ,override,或者 private之类的特殊关键字来做前缀; 这些仅仅作用于此变量的当前实例。

    多目的的值为目的列表中的每一个成员单独创建一个目的特定的变量值。

    VARIABLE-ASSIGNMENT 可以是任何有效的变量赋值;递归(=),静态(:=),连接(+=),或者条件式(?=)。所有的在 VARIABLE-ASSIGNMENT 中出现的变量都是在目的的上下文中被解析:因此,任何之前定义的目的特定的变量值都将有效。注意这个值和全局值彼此独立:这两个不需要保持同样的风格(递归 vs 静态)

    后文待续

  • 相关阅读:
    重温数据结构与算法(1) 构建自己的时间测试类
    读<<CLR via C#>>总结(11) 详谈事件
    读<<CLR via C#>>总结(13) 详谈泛型
    重温数据结构与算法(2) 编程中最常用,最通用的数据结构数组和ArrayList
    由String类的Split方法所遇到的两个问题
    读<<CLR via C#>>总结(6) 详谈实例构造器和类型构造器
    让我们都建立自己的知识树吧
    读<<CLR via C#>>总结(5) 如何合理使用类型的可见性和成员的可访问性来定义类
    读<<CLR via C#>>总结(10) 详谈委托
    读<<CLR via C#>>总结(4) 值类型的装箱和拆箱
  • 原文地址:https://www.cnblogs.com/gaojian/p/2712027.html
Copyright © 2011-2022 走看看