Follow

Talking shop: makefile question 

Is there a reasonably portable way (preferably POSIX, or at least NetBSD and GNU make) to make a file always re-generate regardless of access time? Something like NetBSD make's "!" rules except that works with GNU Make. PHONY feels wrong semantically since it actually is a file, but also it does exactly what I want so maybe I should give up and use that.

Talking shop: makefile question 

I vaguely remember an empty "FORCE" target being used for this (which is a dependency of the thing you want to always update). Feels jank, but maybe I should just go with that.

Talking shop: makefile question 

@sam I do something sorta like you're describing. Have my real target depend on FORCE, and then instead of defining an empty FORCE target I don't define FORCE at all but do have a .PHONY: FORCE. Because FORCE is phony.

Talking shop: makefile question 

@epilanthanomai ahh, I wasn't thinking about the fact that FORCE was PHONY; that makes sense. Thanks, I guess I'll just do that.

Talking shop: makefile question 

@sam that's what PHONY is for. The other option is to use bazel instead, so it's more semantic.

Talking shop: makefile question 

@BreetzTootz PHONY is for things that don't actually generate files (I thought), this does. But it's really a distinction without a difference since it would work exactly the same way, so maybe I should just use it.

Sign in to participate in the conversation
social.coop

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!