I am trying to write a Make rule that says, roughly, “If you need to build target, also build prereq. However, do not rebuild target because prereq changes.”
Right now I am using this hack:
target: otherprereqs
$(MAKE) prereq
RECIPE
Is there a better way of doing this?
All right, I think I know what you mean. If your version of GNUMake is recent enough, you can use order-only prerequisites: