tohava
tohava

Reputation: 5412

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

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?

Upvotes: 0

Views: 345

Answers (1)

Etan Reisner
Etan Reisner

Reputation: 80931

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.

Upvotes: 3

Related Questions