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

    继续翻译

     .SECONDEXPANSION:                        
         main_OBJS := main.o try.o test.o                        
         lib_OBJS := lib.o api.o                        
                            
         main lib: $$($$@_OBJS)                        
                            
       Here, after the initial expansion the prerequisites of both the `main' and `lib' targets will be `$($@_OBJS)'.  During the secondary expansion, the `$@' variable is set to the name of the target and so  the expansion for the `main' target will yield `$(main_OBJS)', or  `main.o try.o test.o', while the secondary expansion for the `lib' target will yield `$(lib_OBJS)', or `lib.o api.o'.                        

    .SECONDEXPANSION:

    main_OBJS :=main.o try.o test.o

    lib_OBJS:= lib.o api.o

    main lib: $$ ($$@_OBJS)

    这里,在对main 和 lib 的目的的前提条件进行了初始的扩展后,得到了 $($@_OBJS)。

    在第二次扩展的时候,$@变量指向 目的的名字,于是对目的main的扩展导致了 $(main_OBJS),进而变成了  main.o try.o test.o, 对 目的lib 的扩展,导致了 $(lib_OBJS), 进而变成了 lib.o api.o。

    (下面一小段是我自己加的标注)

    $$($$@_OBJS) 在第一次扩展后,变化为:
    
    $($@_OBJS)
    对照 main lib  $ ($@_OBJS)
    其实是:
    main : $($@_OBJS) 和 lib: $($@_OBJS)
    
    由于 $@代表了冒号左边,所以演化为:
    main: $(main_OBJS) 和 lib: $(lib_OBJS)
    
    由于前面定义了 $(main_OBJS)和 $(lib_OBJS)
    
    所以进一步地,转化为:
    
    main: main.o try.o test.o
    lib:   lib.o api.o

    后文待续

  • 相关阅读:
    安装django时出错
    mysql ------python3(一)笔记
    安装mysql的具体过程
    Python3web框架---Django、Tornado、Flask的对比
    python3-----json函数
    图片人脸识别年龄和性别
    urllib库的使用(三)-----python3 异常处理
    python 3 基础篇 (一)
    requests,pymysql,django的安装
    求素数方法的改进
  • 原文地址:https://www.cnblogs.com/gaojian/p/2688572.html
Copyright © 2011-2022 走看看