3 ms·
There are relatively painless workarounds for both situations. For multiple outputs, you can just make sure that anybody who depends on %.c also depends on %.h
by apenwarr 16y ago
There are relatively painless workarounds for both situations.
For multiple outputs, you can just make sure that anybody who depends on %.c also depends on %.h. This is pretty easy in the case of yacc. Then the rule can just be one for creating the %.h and you'll still never be missing a build rule.
For the problem of multiple ways to generate the same file (eg. generating a .o from either a .c or a .cpp), you can solve that by simply putting the decision logic into the .do file. This is actually better than making it implicit, because you explicitly get to say exactly which priority order to use in case both .c and .cpp exist. Make would silently pick one or the other (after also wasting time evaluating a bunch of other irrelevant rules, like ones for .pas files), which is no fun when you're debugging.
- beagle3 16y agoThanks (both for the reply and for redo! oh, and for bup and sshuttle!) The multiple-output solution is not very painful, but is kind of error prone, which stands out as redo is otherwise extremely clean, simple and robust. Perhaps something like "yytab.h_and_yytab.c.do" in the filename could work? Quoting myself: > it's actually better than redo doesn't try. This was a type. I mean tot say "actually better that redo doesn't try", which is what you were saying too.