- cross-posted to:
- technology@lemmy.world
- cross-posted to:
- technology@lemmy.world
When I discovered that make treats commands as completely different syntax based on whether the lines start with tabs or spaces I realised it was an insane tool exclusively for masochists
Been using
miseRuns tasks and lock files your repos dependencies and their sources over multiple platforms.
The fundamental problem with all build systems, including
make, is that every platform, every toolchain, and every organization has its own unique ideas about (a) what exactly constitutes a “project,” and (b) what exactly it means to “build” such a thing. Because of this, any build system that attempts to create abstractions for things like “projects,” “dependencies,” “targets,” and so on will inevitably exclude some valid use-cases, and, conversely, any build system that attempts to address all use-cases will eventually end up reinventing shell scripting.makeis a useful tool for turning files into more files. Sometimes, that’s all you need from a build system; sometimes, it’s only part of what you need; and sometimes, what you need is something entirely different.Tldr no problems with makefiles were addressed, this is only a superficial introduction to it that doesn’t match the title of the post. Use
justif you can.The only issue with
justis, that it is another third party tool to depend on. The huge benefit ofmakeis, that this is a trusted tool in core developer toolset. If I were to usejust, why not use something more standard likeninjaorcmake?nix devshells fix this for good
I don’t know how this answers my question.
nix devshells let devs not worry about preinstalled deps like just, comes in handy esp. with larger teams and monorepos. thats how I managed to introduce stuff outside the js ecossystem to my js-centered peers in our project, they just pull the new stuff and the environment installs whatever it needs. its better also because you can make it reproducible like to the exact dependency version (node/uv/git/whatever) so no issues of “works on my machine” arise
makeis just installed by default. Windows is also just installed by default. Using that as an argument to keep something is questionable.And to answer your question “why no
ninjaorcmake?” Because they are complicated af and are for building (mostly) C++ horrors.justis a handy way to save and run project-specific commands.It’s being used more because it’s simple and easy to run. It’s not a build system or whatever
make(poorly) tried to be.make is just installed by default.
No, its not installed by default. But it is a standard tool.
Windows is also just installed by default.
This is irrelevant to our discussion. We are talking about optional tools for developers and Windows is not a tool.
Using that as an argument to keep something is questionable.
It is not questionable to have an argument to use standard tools only. To me it is questionable to question that argument at all.
just is not an established standard tool, compared to make or ninja or cmake. So any objection with the argument its not a standard tool is valid. It does not become invalid just because you said its questionable argument, for no reason.
It is not questionable to have an argument to use standard tools only.
I think it is. It’s a made up constraint that might give you some peace of mind, but it’s not impactful when it takes one command line and a few seconds to install it.
I don’t understand why anyone would only use programs already installed on their machine, you are probably already using make to compile and install something that your machine is lacking.
In case you have reading comprehension problems, I said in case I use just, I would rather prefer using a different third party tool that is more adapted and quasi standards like ninja or cmake. just is not established yet and it doesn’t provide much over make to justify depending on yet another make tool, while there are already lot of projects depending on different make tools.
“I find saying it’s questionable questionable in itself”
Lol, OK. Obviously you’re the bigger brain here. Can’t argue with that.
Nothing to do with big brain. You just don’t accept my objection. But it is a real concern to have, you just don’t care. That’s the difference. Because you can’t argue against it, so you invalidate it by saying its questionable.
It depends on what you need. The uses I have for just are mostly as a command runner, so I gain no benefit from using a more complicated tool.
Should be said, though, that
justlooks superficially similar, but is a very different tool.justis a way of aliasing commands/scripts. You can do that withmakeas well, by whacking.PHONYonto everything, but it really isn’t what it was built for.makeis instead a way of defining rules for how to transform files into other files. For that transformation, you’ll then use commands/scripts, but it’s really about defining a whole build system based on the rules.Perhaps in other words,
justworks best, if your language already has a build tool that you just need to call with different flags.
makeis instead intended to be that build tool, and what it calls underneath is a compiler.
Plain makefiles are horrible if you need to support multiple different platforms that all have their own quirks and build differences.
And also different implementations of make. The author lumps Unix, Linux and BSD together because you’d be likely to have make available on all of them, but neglects to mention that that could easily be three or more different dialects. If you create your Makefiles on Linux you are not at all unlikely to use GNU-specific features (because they’re handy) that won’t work on BSD. Or even features of GNU make 4 that still won’t work on older versions, e.g. what ships by default on Macs.
The way the author speaks about Windows in this context suggests they also don’t realize that Windows has nmake (of course also not really compatible with GNU).
It’s not a coincidence that even when it’s mostly Linux, people use autotools on top, and if it’s more platforms than that handles well, it’s often a set of setup scripts. Or that projects migrated to tools like Cmake, which is one of the worst scripting language designs I have seen in 30 years of professional software development, but makes it much less painful to support multiple platforms with a single build system. Including ones specific to Windows or macOS and so on, but also ninja on Linux that is much faster at incremental builds than make.
The post uses make purely as a command runner. Using make and all it’s quirks for that is not a great idea. I suggest using mise-en-place this instead. Make has its uses, but using it purely for this, isn’t it. I believe just is also a command runner, but all projects need a way to manage version of tools, so might as well use one system for both, and as a bonus, it gives you env var management too!
Just is quite good, especially with multiple modules nested within the project’s directories. It can get a bit unwieldy though and it’s just a bunch of shell scripts underneath when you need to do something complex. That said though I successfully manage a large Unreal Engine project with it and it does building/cooking/testing/deployment on both Win and Linux.
There’s no C make written in C?
Make is pretty jank. I wouldn’t defend it. The only reasons to use it are that it’s pretty much installed by default, and for some reason nobody has written a better version. Kinda weird really. I might vibe code one.
If you don’t believe me, look at how recursive Make works, or how the job server works, or how to support paths containing spaces (you can’t), or
.PHONY, or how the default rule is chosen, or …makehas a huge amount of history, which is pretty much its selling point. We decided recently to introduce it into a project for command aliases, simply because it’s available everywhere.justwould’ve been the objectively better tool for what we want to use it for. But slapping.PHONYonto everything is less big of a deal than telling all devs to install yet another tool before they can get started.Ninja isn’t designed for hand written rules - it’s more of a backend tool.
Redo is barely anything at all. It sounds kind of elegant but I’ve tried it - you basically end up assembling Make yourself from dozens of loose files.
Just isn’t really a build system at all - it’s a “command runner” like
npm run. I’m not sure it can even do dependency tracking like Make can it? In any case in my view it’s worse because they’ve made it super complicated and kitchen sinky.For small stuff ninja is fine and the language is tiny and simple, no mad escaping. It gets completely out the way and you can do a lot before you have to reach for anything else.
Don’t forget Task! It’s yaml based and written in go. I like it. It works well. It has a few rough edges. Unfortunately, I haven’t given Just a chance yet to compare
I haven’t used it yet, but isn’t just a “better” version?
So there are multiple use cases here: one is a script runner, and the other is a directed act mix graph runner with timestamp based pruning.
Make is good for builds because it ignores unmodified data, and just is great as a script runner because it’s way more ergonomic than make to write.
I think they both have a good place, but for most languages other than C you need a script rune and the compiler does all the file selection and pruning.







