Hacker News new | ask | show | jobs
by ivan888 1147 days ago
I'm very new to make(1), but became a fan quickly.

Rather than maintaining documentation that inevitably gets out of date, if a project has a Makefile, it self documents the build process, language independently. No need to read a README to see if people are currently using yarn or npm, or find external documentation on a build tool you haven't used before; the Makefile shows the targets and what commands they run.

4 comments

Just my opinion but make is still the best ci/cd tool. I see way too many places with layers of tools and yaml configs and hosted cvs pipelines (that you can't easily recreate locally), when a make file would do just fine if not better.
It's very, very convenient to have your CI/CD yaml just trigger make targets. Still get the benefits of everything running on Someone Else's Computer, but mostly-to-100% reproducible locally for debugging.
A hard learned lesson we had over at coreboot. Now all the projects we run CI for are heading towards some variant of `make what-jenkins-does` as in https://review.coreboot.org/plugins/gitiles/coreboot/+/refs/...
This is the route I take in my personal projects. Jenkins runs a make file.
I recently started eyeing ninja and for many cases it makes more sense than make.

Still those ci/cd configs should always be very thin wrappers (single command for single thing) around whatever script tooling is used internally.

The tradeoff isn't just about documentation, but complexity. A tedious, manual build process is still tedious and manual if it's self-documenting, but a more streamlined build process without as much documentation might still be less of a burden overall. It's also not like Make doesn't have its own thorny edges too; one person's self-documenting use of a feature is another person's inscrutable magic invocation. If you're working on a team project and already require a certain level of expertise in the ecosystem you're using, it's arguable that using the native build system (warts and all) will be a better tradeoff.
Here you assume that more people know about make than npm or yarn, which I wouldn't bet on.

Besides, I would guess that every JavaScript developer when jumping on the new project will know how to use npm, just like every Java developer would know enough maven, and adding some supposedly general standard tool on top of already standard tools in that area wouldn't help.

> just like every Java developer would know enough maven

Many only know Gradle.

> Many only know Gradle.

True, but maybe 1% knows make. And since many of them run Windows, many don't even know how to install the correct version of make on their development box.

Obviously you haven’t seen > 100 line makefiles. They are a mess to understand and I have no interest in wasting my time to understand what they are doing.
In most of my professional work, a 100 line makefile would be considered a short makefile!

They're not that hard to understand and follow.