zoukankan      html  css  js  c++  java
  • GNU make manual 翻译(六十四)

    继续翻译

       Obviously, this is not a very interesting case since the same result could more easily have been achieved simply by having both variables appear, unescaped, in the prerequisites list.  One difference becomes apparent if the variables are reset; consider this example:  
         .SECONDEXPANSION:                        
         AVAR = top                        
         onefile: $(AVAR)                        
         twofile: $$(AVAR)                        
         AVAR = bottom                        
                            
       Here the prerequisite of `onefile' will be expanded immediately, and resolve to the value `top', while the prerequisite of `twofile' will not be full expanded until the secondary expansion and yield a value of  `bottom'.                        

    很显然,这并不是一个有趣的例子,以为同样的结果可以用更加简单的办法来达成:将所有变量定义好,没有转义符号。但是有一个地方是不同的,即变量被重置的时候;考虑下面的例子:

    .SECONDEXPANSION:
    AVAR = top
    onefile: $(AVAR)
    twofile: $$(AVAR)
    AVAR = bottom

    这里,onefile的前提条件将立即被展开,然后解释为值 top。而twofile的前提条件就不会马上展开,而是要等到第二次扩展,此时的值已经是 bottom。

    后文待续

  • 相关阅读:
    61序列化二叉树
    60把二叉树打印成多行
    59按之字形顺序打印二叉树
    58对称的二叉树
    57二叉树的下一个结点
    56删除链表中重复的结点
    55链表中环的入口结点
    Python100天打卡-Day10
    Python100天打卡
    点至直线的距离和垂足点计算
  • 原文地址:https://www.cnblogs.com/gaojian/p/2688522.html
Copyright © 2011-2022 走看看