gpt4 book ai didi

makefile - 为什么在 Makefile 中使用 exec?

转载 作者:行者123 更新时间:2023-12-02 20:52:15 25 4
gpt4 key购买 nike

Makefile 中是否需要 exec 关键字?

build-cache: clean-cache                                    
@exec ./scripts/copy_packages.sh
./scripts/build_makefile.sh
docker build -t common/cache ./cache

我只是注意到有些行使用了 exec 而有些则没有。

最佳答案

否(exec 不是make 中的关键字);你误解了这一行:

@exec ./scripts/copy_packages.sh

@ 表示在执行此“配方”中的命令时“不要回显此行”。 exec 表示 make 开始运行该行的 shell 将自身替换为脚本 ./scripts/copy_packages.sh

另见 What do @, - and + do as prefixes to recipe lines in make?

关于makefile - 为什么在 Makefile 中使用 exec?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41923158/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com