News for hackers. Stuff that matters.
Re:Using `make` to compile C programs by gylterud on Saturday June 14, 2025 @08:23PM (#44279731)
I love the make reimagination in plan 9: mk. In my experience ok is easier and slightly saner than make. On unix like systems you can get it from plan9port, along with other gems, such as acme.

https://plan9.io/sys/doc/mk.html

https://9fans.github.io/plan9port/

Re:Using `make` to compile C programs by xelxebar on Sunday June 15, 2025 @12:19AM (#44280496)
This was going through my head, too. Though I am somewhat doubtful whether it would be a win on Linux. Mk's ergonomics come from leveraging the cohesiveness of Plan 9 as a system, IMHO.

That said, the automatic variables ($target, $stem, etc.) are more descriptive than those of make ($@, $*, etc) since the former are just normal shell variables passed in at rule runtime I think.

Re:Using `make` to compile C programs by o11c on Saturday June 14, 2025 @10:00PM (#44280070)
How so?

From what I see it is almost* strictly less useful than BSD make, which (IMO) is strictly less useful than Solaris make, all of which are strictly less useful than GNU make. It only might be more useful than SysV make.

* Regex support is unique, but you know what they say about solving problems with regexes, and you can usually do any useful think with `subst` and `word`. The `Pcmp -s` at first seems unique, but can easily be replaced by some stamp/dep file logic, with much better performance.

Don't get confused by the fact that `automake` chooses to maintain compatibility with versions of `make` more than 4 decades old.

Re:Using `make` to compile C programs by gylterud on Sunday June 15, 2025 @02:20AM (#44280868)
I haven’t tried every version of make there is, but a few things about mk off the top of my head:

- Readability: $target, $prereq, $stem is much easier to read than Make’s $@, $<. Any white space can be used to indent.

- Flags after the target to do useful thing such as autodelete target om error (no more confusion on about partial files), and controlling verbosity, and specifying virtualness.

- Stricter when dealing with overlapping targets.

- Has a flag for printing why each target is being generated.

- Regex in targets is sometimes really useful! Taken together with the strictness towards overlapping targets this leads to less confusion overall.