> I've been struggling for some time now with how to write rules for > commands that generate multiple targets
A familiar and annoying problem: make really believes in commands that generate just one (relevant) file, and doesn't fit so well with ones that generate several. > The next thing to try is using a proxy or timestamp file: > > yacc.ts: grammar.y > yacc -d -v $^ > touch $@ > > y.tab.h y.tab.c y.output: yacc.ts A quarter of an hour after reading your mail, I had a mildly perverted idea: instead of a touch-file, use a tar-file ! The problem you point to is when the touch file exists but the files we want don't: we need a command for the rule that declares their dependency on it; and that command needs to be able to generate the outputs from the fake file. yacc.ts: grammar.y yacc -d -v $^ tar cf $@ y.tab.h y.tab.c y.output y.tab.h y.tab.c y.output: yacc.ts tar xf $< -m Note the crucial -m in the extracting tar, so that we touch the outputs after the tar-file has been created, thereby avoiding re-extracting every time we run make. Not sure how well that'd work but it *looks* like it should ... and it should generalise reasonably well. Unfortunately I can't, just yet, see how to turn it into a pattern rule for general .y file processing, Eddy. _______________________________________________ Bug-make mailing list Bug-make@gnu.org http://lists.gnu.org/mailman/listinfo/bug-make