无法命名目标`dev`
Can't name target `dev`
这是我的 Makefile:
catchall = echo "Available make commands: dev, rebuild" && exit 0
.DEFAULT:
@$(catchall)
error:
@$(catchall)
dev:
docker-compose -f docker-compose.dev.yml up --abort-on-container-exit
rebuild:
docker-compose -f docker-compose.dev.yml up --build --abort-on-container-exit
当我 运行 make rebuild
一切都按预期工作时,但是 make dev
给出了这个输出:
make: `dev' is up to date.
如果我将 dev
目标重命名为几乎任何其他命令,该命令将起作用。为什么?
这是 make -v
的输出:
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for i386-apple-darwin11.3.0
这是因为我在同一目录中有一个名为 dev
的文件夹。解决方案是在 Makefile 中添加 .PHONY: dev
。
这是我的 Makefile:
catchall = echo "Available make commands: dev, rebuild" && exit 0
.DEFAULT:
@$(catchall)
error:
@$(catchall)
dev:
docker-compose -f docker-compose.dev.yml up --abort-on-container-exit
rebuild:
docker-compose -f docker-compose.dev.yml up --build --abort-on-container-exit
当我 运行 make rebuild
一切都按预期工作时,但是 make dev
给出了这个输出:
make: `dev' is up to date.
如果我将 dev
目标重命名为几乎任何其他命令,该命令将起作用。为什么?
这是
make -v
的输出:
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for i386-apple-darwin11.3.0
这是因为我在同一目录中有一个名为 dev
的文件夹。解决方案是在 Makefile 中添加 .PHONY: dev
。