【问题标题】:pipe after colon in makefile: /home/.ssh/config: | /home/.ssh [duplicate]makefile 中冒号后的管道:/home/.ssh/config: | /home/.ssh [重复]
【发布时间】:2020-11-27 00:56:59
【问题描述】:

| 在下面的 makefile 中是什么意思?

/home/.ssh:
    install -d -m 700 /home/.ssh

/home/.ssh/config: | /home/.ssh
    echo "$$CONFIG" >> $@

/home/.ssh/credentials: | /home/.ssh
    echo "$$CREDENTIALS" >> $@

谢谢

【问题讨论】:

    标签: makefile pipe


    【解决方案1】:

    管道字符将与先决条件规则的关系声明为仅订单¹类型。在这里,如果/home/.ssh 不存在,无论如何都会创建它,但如果它的时间戳发生变化,其他任何事情都不会因此而发生。


    ¹:https://www.gnu.org/software/make/manual/html_node/Prerequisite-Types.html

    【讨论】:

      猜你喜欢
      • 2018-11-17
      • 2012-06-01
      • 1970-01-01
      • 2013-11-17
      • 1970-01-01
      • 1970-01-01
      • 2020-06-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多