gpt4 book ai didi

makefile - 我是否应该使用 .PHONY?

转载 作者:行者123 更新时间:2023-12-05 07:55:36 27 4
gpt4 key购买 nike

<分区>

我正在使用生成文件来运行测试。我不确定 .PHONY 的使用。我读过这篇文章:What is the purpose of .PHONY in a makefile? , 但我仍然不确定。

我有以下生成文件:

```

test:
@# Clear console log before we start.
@clear

# Make sure we are not having too much modules.
@npm prune

# Make sure we have the required modules.
@npm install

@# Clear the console, so we only see the test results.
@clear

# Run the test.
@./node_modules/.bin/mocha-casperjs test.js --reporter=spec

```

我的 make test 命令没有生成任何新文件。我是否应该使用 .PHONY: 测试?但更重要的是,为什么? (或者为什么不呢?)

谢谢!

马尔科姆·金德曼斯

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