If I have a target that is a soft symlink, the natural way to write the rule would be:
MAKEFILE := $(lastword $(MAKEFILE_LIST))
ln -sf to $@
Except it does not work, if Makefile changes and becomes newer than "to", "from" is rebuilt all the time. I want to only consider the timestamp of the link file, not in addition to the timestamp of the linked file, but instead of.
How to do this? Clearly it has to depend on the Makefile, since if you change the rule to a different "to" file, the link must rebuild. But that also causes it to always rebuild.