• GNU make manual 翻译(六十八)


    继续翻译

    Secondary Expansion of Explicit Rules                        
    -------------------------------------                        
                            
    During the secondary expansion of explicit rules, `$$@' and `$$%' evaluate, respectively, to the file name of the target and, when the target is an archive member, the target member name.  The `$$<'  variable evaluates to the first prerequisite in the first rule for this  target.  `$$^' and `$$+' evaluate to the list of all prerequisites of  rules _that have already appeared_ for the same target (`$$+' with 
    repetitions and `$$^' without).  The following example will help  illustrate these behaviors:                        
                            
         .SECONDEXPANSION:                        
                            
         foo: foo.1 bar.1 $$< $$^ $$+    # line #1                        
                            
         foo: foo.2 bar.2 $$< $$^ $$+    # line #2                        
                            
         foo: foo.3 bar.3 $$< $$^ $$+    # line #3                        
                            
       In the first prerequisite list, all three variables (`$$<', `$$^', and `$$+') expand to the empty string.  In the second, they will have  values `foo.1', `foo.1 bar.1', and `foo.1 bar.1' respectively.  In the  third they will have values `foo.1', `foo.1 bar.1 foo.2 bar.2', and  `foo.1 bar.1 foo.2 bar.2 foo.1 foo.1 bar.1 foo.1 bar.1' respectively.   

    在对显式规则进行二次扩展期间,

    当目的是一个归档的成员,$$@ 和 $$% 分别被解析成为目的的名称--目的成员的各个名称。

    $$< 变量给出此第一个规则里的目的的第一个前提条件。

    $$^ 和 $$+ 此规则的所有的前提条件列表($$+ 有重复运算能力,$$^则没有)

    下面是一个例子,可以帮组我们理解其行为:

    .SECONDEXPANSION:

    foo: foo.1 bar.1 $$< $$^ $$+ # line #1

    foo: foo.2 bar.2 $$< $$^ $$+ # line #2

    foo: foo.3 bar.3 $$< $$^ $$+ # line #3

    In the first prerequisite list, all three variables (`$$<', `$$^',
    and `$$+') expand to the empty string. In the second, they will have
    values `foo.1', `foo.1 bar.1', and `foo.1 bar.1' respectively. In the
    third they will have values `foo.1', `foo.1 bar.1 foo.2 bar.2', and
    `foo.1 bar.1 foo.2 bar.2 foo.1 foo.1 bar.1 foo.1 bar.1' respectively.

    在第一行的前提条件列表中,此三个变量($$<,$$^,$$+)分别都是空串。

    在第二行,它们将分别拥有 foo.1, foo.1 bar.1  和 foo.1 bar.1 的值。

    在第三行,它们将分别拥有

            foo.1  

            foo.1 bar.1  foo.2 bar.2 

            foo.1 bar.1  foo.2 bar.2  foo.1 foo.1 bar.1  foo.1 bar.1 

    后文待续

  • 相关阅读:
    C语言学习笔记(二)数据类型、常量和变量简介
    将汉字转换为汉语拼音java实现
    C语言学习笔记(四)运算符与表达式(下)
    数组的几种排序算法的实现
    C语言学习笔记(三)运算符与表达式(上)
    java实现二叉树的常见操作
    java解析Internet网页中的内容
    C语言学习笔记(六)分支程序设计
    C语言学习笔记(一)初识C语言
    C语言学习笔记(五)顺序程序设计
  • 原文地址:https://www.cnblogs.com/gaojian/p/2688606.html
Copyright © 2020-2023  润新知