我一直在使用像這樣的奇怪規則很長一段時間,但突然間他們打破了新的環境。%*和依賴關係線上的*
有沒有一個強大的方法來做到這一點?
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 –