我一直在使用像这样的奇怪规则很长一段时间,但突然间他们打破了新的环境。%*和依赖关系线上的*
有没有一个强大的方法来做到这一点?
all: test.1.out
test.%.out: %/test*.out
/bin/cp -f $< [email protected]
在我的箱子(Ubuntu的):
alishan:~/Dropbox/make_insanity> make --version
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 x86_64-pc-linux-gnu
alishan:~/Dropbox/make_insanity> make
/bin/cp -f 1/test.out test.1.out
与这种对别人的Mac电脑代码,Ubuntu机器,Ubuntu的虚拟机没有问题。不知道他们的所有版本,但它似乎是OK代码。
清除后,在我的mageia服务器在同一目录。
[[email protected] make_insanity]$ make --version
GNU Make 3.82
Built for x86_64-mageia-linux-gnu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
[[email protected] make_insanity]$ make
make: *** No rule to make target `test.1.out', needed by `all'. Stop.
[[email protected] make_insanity]$
更改任的%
或*
到适当的文本“修复”的问题,但当然不会产生所期望的一般性。
有人向我暗示,从3.81改为3.82是可能的罪魁祸首。我查看了发行说明,但没有发现任何似乎适用的内容。 https://lists.gnu.org/archive/html/make-alpha/2010-07/msg00025.html –