Greetings,

I was confused by the behavior of the following Makefile:
somedata-%.txt:
xxd /dev/urandom | head -30 > $@

final-%.txt: somedata-%.txt
wc $< > $@
.PRECIOUS: somedata-%

Despite my expectations, make deletes somedata-foo.txt:
$ make -f mwe.mk final-foo.txt
xxd /dev/urandom | head -30 > somedata-foo.txt
wc somedata-foo.txt > final-foo.txtrm somedata-foo.txt

I found that changing the last line to ".PRECIOUS: somedata-%.txt" gives me 
what I want, and that this matches the behavior described in the documentation. 
However, I think this behavior is a bit inconvenient, and was curious if this 
could be changed. I think it would be useful to list more generic .PRECIOUS 
prerequisite patterns. No idea what the downsides or back-compatibility of this 
feature would be though, so I'm interested to hear maintainers' thoughts.

Thank you for your time.

Reply via email to