Ho usato strane regole come questa per molto tempo, ma all'improvviso si stanno infrangendo in un nuovo ambiente.% e * insieme sulla linea di dipendenza
C'è un modo efficace per farlo?
all: test.1.out
test.%.out: %/test*.out
/bin/cp -f $< [email protected]
Sulla mia casella (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
Nessun problema con questo tipo di codice su Mac di altre persone, macchine Ubuntu, Ubuntu macchine virtuali. Non so tutte le loro versioni di make, ma sembra un codice OK.
Sul mio server mageia nella stessa directory dopo la cancellazione.
[[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]$
Modifica sia la %
o *
ad opportuni testo "fissa" il problema, ma naturalmente non produce la generalità desideri.
Mi è stato suggerito che il cambiamento da fare 3.81 a 3.82 è il probabile colpevole. Ho guardato le note di rilascio ma non ho trovato nulla che sembrasse applicarsi. https://lists.gnu.org/archive/html/make-alpha/2010-07/msg00025.html –