无法命名目标`dev`

Kevin Shi

这是我的 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
Kevin Shi

这是因为我在同一个目录中有一个名为dev. 解决方法是添加.PHONY: dev到Makefile中。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章