Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Thank you, I have seen it, but I prefer Make.


I bet all your targets are .PHONY?


But I can install it on any Linux system from the base repository


If all your targets are .PHONY, you might as well just as bash (or your favourite shell) directly.

Make targets look suspiciously like functions (or procedures), but they actually aren't.


I don't typically use .PHONY as my targets aren't the same name as files and performance isn't an issue.

Here is an example of a "complex" Makefile I use to help manage Helm deployments (https://github.com/peterwwillis/devops-infrastructure/blob/m...). It uses canned recipes, functions (for loops), default targets, it includes targets and variables from other Makefiles, conditionally crafts argument lists, and more. (It's intended to be a "default" Makefile that is overridden by an additional Makefile.inc file)

I could absolutely rewrite that in a shell script, but I would need to add a ton of additional code to match the existing functionality. Lines of code (and complexity) correlates to bugs, so fewer lines of code = less bugs, so it's easier to maintain, even considering the Make-specific knowledge required.

They say "use the best tool for the job". As far as I've found, for a job like that, Make fits the best. If some day somebody completely re-writes all the functionality of Make in a less-obnoxious way, I'll use that.


> I don't typically use .PHONY as my targets aren't the same name as files and performance isn't an issue.

They are still phony at heart in this case, even if you don't declare them .PHONY.

Make really wants to produce files; if your targets don't produce the files they are named for you are going to run into trouble (or have to be rather careful to avoid the sharp edges).

> They say "use the best tool for the job". As far as I've found, for a job like that, Make fits the best. If some day somebody completely re-writes all the functionality of Make in a less-obnoxious way, I'll use that.

You could try eg Shake (https://shakebuild.com/), but it requires some Haskell.


One of the benefits of just -- it isn't a build system, it's a command runner.

Good facilities for arguments, builtins like absolute locations -- there are a ton of benefits (see the README).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: