Hacker News new | ask | show | jobs
by boomlinde 2376 days ago
> Make is more than a build system, it's also an automation tool.

I agree with that, but I don't believe that the GP said otherwise. Make is an automation tool, but what it aims to automate is exactly dependency tracking. Other features, like actually performing the tasks, are off-loaded to the shell and other tools.

> It gives you a fairly flexible format for managing different tasks with shared variables and autocompletion and more.

You could as well be describing a shell here, which already have these features.

> You can do it with a bunch of shell scripts too but I prefer having everything in a single file.

What stops you from using a single shell script? Likewise, you have a Makefile delegate tasks to other Makefiles (as the author has done for the build-tokenizer rule).

Anyway, you should of course use them in any manner that suits you, but for a guide on "using Makefiles for Go" I think it's an oversight to ignore the main selling point of make by just using it as you would a switched shell script with no dependency tracking. It just introduces another syntax and new caveats to the problem, adding little value.

1 comments

I think people kind of talk past each other in these discussions because there isn't a standardised vocabulary. I would call that kind of anaemic Makefile a "task runner" rather than a build system. And yes indeed, a task runner can easily be written as a single POSIX/Bash shellscript that has conditional behaviour based on its first argument. The `case ... in ...` statement in shell is rather nice!