我有一个简单的 bash 脚本,用于安装和压缩 NodeJS 应用程序。它在当地工作得很好。现在我想从 Makefile 执行这个脚本。所以我写了这段代码
.FOO: install_and_zip
install_and_zip: ./install_and_zip_foo.sh
Run Code Online (Sandbox Code Playgroud)
因此,如果我使用此 Makefile 运行此文件,则会make foo收到此错误消息:
make: *** No rule to make target `foo'. Stop.
Run Code Online (Sandbox Code Playgroud)
Makefile 和 bash 脚本在同一目录中。
我做错了什么?你能帮我修复这个 Makefile 吗?
不同的错误。这将起作用:
foo: install_and_zip
install_and_zip:
# next line must start with a real TAB (ASCII 9)
./install_and_zip_foo.sh
Run Code Online (Sandbox Code Playgroud)
foo,则调用规则foo,而不是FOOor .FOO。规则foo调用规则install_and_zip。这是你的愿望吗?否则这也会这样做:
foo:
# next line must start with a real TAB (ASCII 9)
./install_and_zip_foo.sh
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5724 次 |
| 最近记录: |