top | item 30151788

(no title)

cytzol | 4 years ago

If you're using Make as a command runner or a "standard entry point" to a project, instead of using it as a build system that tracks dependencies between files, I highly recommend using `just` instead: https://github.com/casey/just

It has this functionality built-in, and avoids a lot of Make's idiosyncrasies. (Not affiliated, just a fan.)

discuss

order

delusional|4 years ago

I think part of the appeal of make as a script runner is the ubiquity.

GordonS|4 years ago

Was going to say the same thing.

Make is fiddly, has gotchas and is far from perfect, from the development side - but it's certainly "good enough", and it's great once you've got your Makefile done. And it's available, or at least easily attainable, pretty much everywhere. I even use it on Windows.

Arnavion|4 years ago

Also, if you add a new target that would benefit from tracking dependencies between files, then make is already ready to do that.

I use makefiles for my Rust code with just default+test+install targets that do no dependency tracking (since Rust's build system already does that much better). But if I need to add a target for, say, validating some OpenAPI spec that only needs to run if the spec file updates, then that can go in the same Makefile.

davidjfelix|4 years ago

Yeah, but if you follow the advice FTA, you now have to rely on a usable python version and make. Still fairly common, but what if I use node instead? I think the point is -- the more usability you add the more you potentially dilute how ubiquitous it is. I think it's okay to point to new tools in the space that shake things up and add usability for the purposes Make currently is used for. Ubiquity doesn't happen over night.

andreineculau|4 years ago

From GNU Make webpage:

> GNU Make is a tool which controls the generation of executables and other non-source files of a program from the program's source files.

What is idiosyncratic is to think Make is first a command runner, and only after a file generator, and complain that it is doing a poor job at the former when it clearly says it is focusing on the latter.

I read the "idiosyncrasies" section on the just README and they are all performance related targeting file generation. All of those can be learned in one minute, as part of "I'll always find Makefiles in the wild, it's good to know the basics".

lights0123|4 years ago

I wanted to use Just at one point, but was disappointed that it doesn't support parallel execution. I ended up making a quick tool to convert a ZSH file into a Ninja file to take advantage of its pool feature.