我很长一段时间一直在使用像这样的奇怪规则,但突然之间他们正在打破一个新的环境.
有没有一种强有力的方法来做到这一点?
all: test.1.out
test.%.out: %/test*.out
/bin/cp -f $< $@
Run Code Online (Sandbox Code Playgroud)
在我的盒子上(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
Run Code Online (Sandbox Code Playgroud)
在其他人的Mac,ubuntu机器,ubuntu虚拟机上使用这种代码没问题.不知道他们所有的make版本,但它似乎好的代码.
清除后在我的mageia服务器上的同一目录中.
[dushoff@yushan make_insanity]$ make --version
GNU Make 3.82
Built for x86_64-mageia-linux-gnu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: …Run Code Online (Sandbox Code Playgroud)