I would like to have a Makefile target that gets rebuilt only if the target file is older than some time interval.
As an example, say that I have some way of generating a key that is valid for one day, but generating it takes a non-trivial amount of time. I could just regenerate it each time I needed it:
.PHONY: key
key:
sleep 5 && echo generated > key
foo: key
echo foo
bar: key
echo bar
But, over the course of the day, I might type make foo
or make bar
quite a few times. Waiting each time is annoying, and I would rather just eat this cost once per day.