why I actually like make
Make might not be the be the answer to all the things, but in my fairly extensive experience using it to automate build tasks in a shell, it’s pretty damn good at what it does.
It’s been around for ages, and has been taking heat for almost that long for being overly complex. There’s a reason it’s still around, folks. Here’s some key features that forced my hand when considering alternatives.
Challenge: find a place you can’t install make. Seriously. Make is available everywhere from tiny embedded Alpine Linux to your daily laptop OS. And you don’t need to install myriad dependencies to obtain it.
Make install on Alpine Linux, a torn down bare bones embedded Linux variant, takes all of two seconds.
/ # time apk add --update make
(1/1) Installing make (4.1-r0)
OK: 6 MiB in 16 packages
real 0m 2.28s
user 0m 0.09s
sys 0m 0.00s
simulation / dry-run
Make’s dry-run mode is pretty great. What a perfect example of a minimal feature that takes things to the next level. Why isn’t this everywhere?
dependency fulfillment / ordered execution
Yes, it’s limited. But in cases where files mark the fulfillment of dependencies, it’s usable.
Before you use parallel execution make sure your task dependencies are set up properly. Once you get it right, it’s great to watch things speed up for free. Caveat: don’t request user input in parallel builds, it ain’t pretty.
I don’t think anyone will argue that it’s pretty easy to scan a makefile and see what tasks are defined, especially if you’ve got a halfway decent syntax highlighting enabled. It’s a step toward self-documenting, and that’s good in my book.