Live data from Hacker News

How I stopped worrying and loved Makefiles

gagor.pro

131–140 of 144 posts

Re: How I stopped worrying and loved Makefiles

#131

The fact that make is basically useless on Windows still makes it "not the first thing to try", to be honest. And it's rare to still see a project that can't be cross-platform, only lots that went "well my computer runs XYZ so I'm only compiling on that" =)

Make works just fine on Windows.

If you’re very careful with forward-vs-back slashes and your username isn’t “Firstname Lastname”, sure. But in practice there are tons of issues especially for non expert users

Re: How I stopped worrying and loved Makefiles

#132

Earlier quoted context omitted.

Why invoke it via make when it can invoke itself? It's just another dependency that's not needed in this scenario.

Make is leaner and more agile than a custom CLI. It takes no time to get started, and there is no boilerplate. Removing or adding steps is trivial, running shell commands is trivial, and hooking into the dependency graph is trivial. Parallelism is built-in, as is dependency resolution. Tab-completion is standard on most Linux distros. It's also better from an architectural separation perspective. Your custom CLI will…

I know a lot of developers who agree with you.

But how is make dependency free? You need to install make. Which version? GNU make, or FreeBSD make? What platform are you installing it on? What version? In my team we had to get all our devs to manually upgrade from 3 to 4 as we were using modern make features to make it a nicer task runner.

These are all things you've already had to deal with in the custom CLI, which is also a perfectly good entry point. You also have a lot more control of command line arguments, rather than just make targets ("just" has also added this as a feature)

Re: How I stopped worrying and loved Makefiles

#133
There is quite a lot to love about make! I still haven't seen an alternative that is substantially better, and most are worse in one way or another.

My opinion may be a bit skewed by the fact that I write code that gets built on a variety of different platforms, though, and make is essentially universal. It lets me have a consistent build process regardless of platform.

It's also very useful for automation that isn't related to building code.

Re: How I stopped worrying and loved Makefiles

#135
post #50

This pattern of usage always seems like abuse. When `make` is used as a glorified front-end to `bash` scriptlets, why not use `bash` directly instead of having two-level of scripting? See: https://blog.aloni.org/posts/bash-functional-command-relay/

Also there are plugins for all editors to allow clicking on a target and it runs code. This would be significantly harder with bash.

Re: How I stopped worrying and loved Makefiles

#137
post #94

Earlier quoted context omitted.

I've always wanted to use one of those, but you have to convince the other developers on your team to use it as well. Make is a relatively easy sell because it's on pretty much every system or at least trivial to install and has decades of reputation.

This is why I'm uninterested in just. I'd rather just use make than add another dependency.

It would have taken you less time to install it than it took you to write your comment.

Re: How I stopped worrying and loved Makefiles

#138

Earlier quoted context omitted.

This is why I'm uninterested in just. I'd rather just use make than add another dependency.

It would have taken you less time to install it than it took you to write your comment.

You're not accounting for updating my hundreds of existing Makefiles and CI config, and asking users to install yet another build dependency.

Re: How I stopped worrying and loved Makefiles

#139

Earlier quoted context omitted.

This is why I'm uninterested in just. I'd rather just use make than add another dependency.

Heresy, I know, but Make is a dependency in windows land.

Luckily few of my users build from source on Windows.

Re: How I stopped worrying and loved Makefiles

#140

Earlier quoted context omitted.

It would have taken you less time to install it than it took you to write your comment.

You're not accounting for updating my hundreds of existing Makefiles and CI config, and asking users to install yet another build dependency.

If it's hundreds, I'll agree with you, obviously that would be a huge effort to migrate.

But you made the argument that adding another build dependency is somehow difficult or undesirable which I can't see; the tool is installed in seconds on all major OS-es and package managers.

So let's not conflate those two separate things, yeah?

Post reply on HN