News for hackers. Stuff that matters.
Re:Recursive Make Considered Harmful (1997) [pdf] by jjnoakes on Sunday May 26, 2019 @11:20AM (#20015338)
> But make is a tool that does two things and does them simple and well: it tracks dependencies between files, and [...]

Last I checked, make only handled dependencies with multiple inputs and a single output.

If your build step's command produced more than one output and you wanted to model that in your DAG you had to resort to some questionable incantations that never really worked perfectly (or rely on non portable constructs).

Re:Recursive Make Considered Harmful (1997) [pdf] by cmm on Sunday May 26, 2019 @11:37AM (#20015435)
firstly, the upcoming version of GNU Make will indeed support multiple outputs in non-pattern rules (pattern rules always supported this, but pattern rules, uhh, have their own problems), using &: instead of :, resolving a bug from 2004. don't you just love the solid pace of those old GNU projects.

secondly, working around this was never very hard, albeit ugly: pretend your rule builds just one of the targets and have the other products depend on that one and simply touch themselves up to its timestamp.

Re:Recursive Make Considered Harmful (1997) [pdf] by jjnoakes on Sunday May 26, 2019 @01:13PM (#20016005)
I disagree with the characterization that this is "not very hard" (and my initial assessment was "questionable incantations" which I think is also accurate):

https://www.gnu.org/software/automake/manual/html_node/Multi...

Definitely not handled "simple and well" as posited by the OP.

Re:Recursive Make Considered Harmful (1997) [pdf] by cmm on Sunday May 26, 2019 @01:54PM (#20016314)
the horrible contortions listed on the linked page are required for the pathological "some of the targets that are built together got deleted, but the primary one did not" case, which in my experience Does Not Happen (or when it does, it is a symptom of deeply suspect practices -- like shitting where you ea^W^W^W^Wkeeping build artifacts and sources in the same directory, or relying on manually deleting artifacts to force a rebuild instead of getting the bloody dependencies right in the first place, etc.)
Re:Recursive Make Considered Harmful (1997) [pdf] by cmm on Sunday May 26, 2019 @02:02PM (#20016371)
(I guess what I'm trying to say here is that the 80% solution is not nearly as hard as that linked page makes it seem).
Re:Recursive Make Considered Harmful (1997) [pdf] by kazinator on Monday May 27, 2019 @01:47AM (#20019728)
POSIX make doesn't specify any feature for multiple outputs.

Some rather obscure makes that you and I will never get to use have had the feature.

GNU Make has, for a long time, supported multiple outputs in pattern rules. Pattern rules have the limitation that the files involved have to be organized around a common stem. If you can make your situation fit this restriction, then you can effectively have multi-target rules by way of pattern instantiation, and this will work with even old versions of GNU Make.

Some two months ago I added the feature to GNU Make to express direct rules with multiple outputs.

http://git.savannah.gnu.org/cgit/make.git/commit/?id=8c888d9...

So bleeding edge GNU Make lets you do:

  y.tab.c y.tab.h y.output &: parser.y ...
It had to be done via a bit of new syntax because

  x y z : w
already has a meaning: it means that x, y and z independently depend on w, not as a group built together.