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.
$(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.