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。

    后文待续

  • 相关阅读:
    Linux 文本编辑器 vim
    Redis 学习(一)
    Linux服务管理
    Linux系统管理
    Linux文件系统管理
    深入解析 composer 的自动加载原理 (转)
    Composer 的学习
    GBDT算法简述
    随机森林入门与实战
    主成分分析PCA
  • 原文地址:https://www.cnblogs.com/gaojian/p/2688522.html
Copyright © 2011-2022 走看看