What is Nostr?
Nicolas Martyanoff /
npub1dkg…54dt
2024-11-08 21:33:37

Nicolas Martyanoff on Nostr: GNU Make never stops to amaze me. I'm working on a particularly complex Makefile, and ...

GNU Make never stops to amaze me. I'm working on a particularly complex Makefile, and today I learned about "file".

$(file <my-file) will expand to the content of my-file. If the file does not exist, it will expand to the empty string. Fortunately there is also "or", so you can simply write things such as $(or $(file <VERSION),latest)).

Of course you can also write files with $(file >my-file,content).

GNU Make gives me the same feeling as Emacs: weird and convoluted, but so useful.
Author Public Key
npub1dkg70vzk4vvfsc5cup9gkfu2tcrs5unysl7npfvegf78nkuswr5skh54dt