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

    继续翻译

    4.6 Phony Targets
    =================
    
       A phony target is one that is not really the name of a file; rather it is just a name for a recipe to be executed when you make an explicit request.  There are two reasons to use a phony target: to avoid a conflict with a file of the same name, and to improve performance.
    
       If you write a rule whose recipe will not create the target file, the recipe will be executed every time the target comes up for remaking. Here is an example:
    
         clean:
                 rm *.o temp
    
    Because the `rm' command does not create a file named `clean', probably no such file will ever exist.  Therefore, the `rm' command will be executed every time you say `make clean'.  

    4.6 伪目标
    =================

    伪目标不是一个文件的真实名字,它其实只是一个,你给make显式要求时要执行的片段的名字。

    有两个原因需要使用伪目标: 防止和同名的文件冲突,提高性能。

    如果你写了一个规则,其片段不是要创建目的文件,这个规则可以每次运行。下面是一个例子:

    clean:
    rm *.o temp

    因为 rm 命令不生成一个名为 clean 的文件,可能这个文件也永远不会存在,因此,每次你输入 make clean 时,这个rm 命令都会得到执行。

    后文翻译

  • 相关阅读:
    在CentOS 8 上 部署 .Net Core 应用程序
    Asp.Net Core 查漏补缺《一》 —— IStartFilter
    接口相关数据日志打印
    退款
    识别身份证
    生成二维码
    打造一款简单易用功能全面的图片上传组件
    Redis过期策略+缓存淘汰策略
    Redis主从复制
    .net 平台常用框架
  • 原文地址:https://www.cnblogs.com/gaojian/p/2694718.html
Copyright © 2011-2022 走看看