• GNU make manual 翻译( 一百零三)


    继续翻译

    Now you can say just `make' to remake all three programs, or specify as
    arguments the ones to remake (as in `make prog1 prog3').  Phoniness is
    not inherited: the prerequisites of a phony target are not themselves
    phony, unless explicitly declared to be so.
    
       When one phony target is a prerequisite of another, it serves as a
    subroutine of the other.  For example, here `make cleanall' will delete
    the object files, the difference files, and the file `program':
    
         .PHONY: cleanall cleanobj cleandiff
    
         cleanall : cleanobj cleandiff
                 rm program
    
         cleanobj :
                 rm *.o
    
         cleandiff :
                 rm *.diff

    现在你可以仅仅输入 make 来重新构建所有这三个程序,或者知道指定参数来构建一部分(例如 make prog1 prog2),伪目的不能继承:伪目的的前提条件不能是伪目的,除非明确地进行了如此的宣言。

    当一个伪目的是另一个伪目的的前提条件时,它就像是另一个的子程序一样进行工作。例如,这里的 make cleanall 将删除目标文件,差异文件和 program文件:

    .PHONY: cleanall cleanobj cleandiff

    cleanall : cleanobj cleandiff
    rm program

    cleanobj :
    rm *.o

    cleandiff :
    rm *.diff

    后文待续

  • 相关阅读:
    UVA 12657 Boxes in a Line 双向链表模拟
    C语言单片和C#语言服务器端DES及3DES加密的实现
    关于TcpClient,Socket连接超时的几种处理方法
    拿来参考的学习计划
    faire la course
    今日法语2
    炸鱼
    今日法语
    今日疑问
    下周想做的菜
  • 原文地址:https://www.cnblogs.com/gaojian/p/2695293.html
Copyright © 2020-2023  润新知