News for hackers. Stuff that matters.
Re:Using Make – writing less Makefile by nine_k on Tuesday December 26, 2023 @05:40PM (#38776884)
No, no. Make's principal purpose is to put a set of files into a desired state. It can "make" a particular file by invoking a dependent graph of commands that produce that file from other files. It checks timestamps and only run steps where the resulting files are older than some of the (transitive) source files.

You can invoke it by naming a named rule, not a file, but the logic will remain.

If this is not what you want to be doing, and if your Makefile is full of .PHONY targets, you likely need a Justfile instead, or (worse) plain shell scripts.

Re:Using Make – writing less Makefile by KajMagnus on Tuesday December 26, 2023 @06:11PM (#38777090)
I also don't like Make for running commands.

I was using Make for running commands, but it interprets all command line parameters as build targets, which was annoying. And Bash scripts in Makefiles aren't type safe, became messy.

Nowadays I use Make only for building. And Deno + Typescript instead, for running commands & scripts.

(Hadn't heard about Just — the scrips aren't type safe though?)

Re:Using Make – writing less Makefile by maleldil on Tuesday December 26, 2023 @07:14PM (#38777538)
> Hadn't heard about Just — the scrips aren't type safe though?

Just runs code written in other languages. It's `sh` by default, but you can define anything (e.g. `python3 -c` to run Python scripts).

Re:Using Make – writing less Makefile by gregwebs on Wednesday December 27, 2023 @10:33AM (#38782940)
depends on how you define type-safe. Even in TypeScript you are still executing strings when running commands. You can turn those strings into variables and share them as a form of type safety- the type check will fail if you mis-type the variable name. Just supports that- you will get an error if a variable that is being inserted doesn't actually exist. The error will occur at startup before usage or can be checked ahead of time with just --check --fmt. So for quick usage there's not much benefit to TS, but over time in TS you could build up type safe interfaces to commands and obviously if you want to run TS scripts instead of shell scripts that's going to have more opportunities for strong typing then invoking TS from just.
Re:Using Make – writing less Makefile by BeetleB on Tuesday December 26, 2023 @09:11PM (#38778324)
I tell people not to use make if there's no need for a dependency graph.

Just don't.

And do just :-)

Re:Using Make – writing less Makefile by twaw on Wednesday December 27, 2023 @01:14AM (#38779545)
Yeah, use make -j8 instead.