GNU make - depend only on file existence and not modification time

332 views Asked by At

I want to have a makefile in which I have a task a that can only run if a file b exists, but does not need to be re-run if b is updated. How do I do this?

1

There are 1 answers

2
Etan Reisner On BEST ANSWER

You want an order-only prerequisite:

Occasionally, however, you have a situation where you want to impose a specific ordering on the rules to be invoked without forcing the target to be updated if one of those rules is executed. In that case, you want to define order-only prerequisites.

Note that this is not necessarily supported by all versions of make.