4 ms·
Indeed, declerativeness and conventions but also dependency resolving and ubiquity are the main plusses for me. Bash scripts used for these tasks tend to accru
by aequitas 6y ago
Indeed, declerativeness and conventions but also dependency resolving and ubiquity are the main plusses for me.
Bash scripts used for these tasks tend to accrue a lot of boilerplate and every script has it's own conventions. So every time you need to debug them you need to debug a lot of code.
With make every target can be it's own little isolated piece of code with input and output which makes reasoning about them a lot easier.
A few tips when learning makefiles: terminology[0]: it's a lot easier to find answers if you know what it's called what you are searching for. Automatic Variables[1]: learn these by heart, and the way they allow DRY targets. If you have a dependecy that is not a file you can use a dot prefixed file as a proxy.
[0] https://www.gnu.org/software/make/manual/html_node/Rule-Syntax.html https://www.gnu.org/software/make/manual/html_node/Rule-Synt...
[1] https://www.gnu.org/software/make/manual/html_node/Automatic-Variables.html https://www.gnu.org/software/make/manual/html_node/Automatic...