3 ms·
#1 -- No, this is the "obvious but wrong" solution. It doesn't work for parallel builds. https://www.cmcrossroads.com/article/rules-multiple-outputs-gnu-make
by chubot 9y ago
#1 -- No, this is the "obvious but wrong" solution. It doesn't work for parallel builds.
https://www.cmcrossroads.com/article/rules-multiple-outputs-gnu-make https://www.cmcrossroads.com/article/rules-multiple-outputs-...
All his criticisms are correct except maybe #3 which I don't understand.
Another problem I've found is that Make doesn't consider the absence of a prequisite to mean the target is out of date. So if foo.html depends on foo.intermediate, and then you delete foo.intermediate, then "make foo.html", foo.html will be considered up to date. I guess this is part of the odd feature where Make deletes intermediaries, but even if you have .SECONDARY on, which I do, it still behaves this way.
The bottom line is that it's extraordinarily easy to write incorrect Makefiles -- either underspecifying or overspecifying dependencies -- and it's very difficult to debug those problems. My Makefile is still full of bugs, so I "make clean" when something goes wrong.
One thing that would go a long way is if it had a shorthand for referring to the prequisites in commands, like $P1 $P2 $P3, and if it actually enforced that you use those in the command lines! I don't want to create variables for every single file, and when I rename files, rules can grow invisible bugs easily.
Some details here: http://www.oilshell.org/blog/2017/05/31.html http://www.oilshell.org/blog/2017/05/31.html