On 02/23/2013 04:38 AM, Paul Smith wrote: > On Sat, 2013-02-23 at 02:32 +0000, Ian Lynagh wrote: >> The problem was that our compiler generates 2 output files (foo.o and >> foo.hi) when compiling one source file, and we had thus ended up with >> a bunch of rules like >> %.hi: %.o ; > The right way to declare a rule that generates multiple targets is: > > %.o %.hi : %.c > ... > > In particular this won't break things when parallel builds are involved. > Is there some reason that doesn't work for you? > One caveat to note if implementing Paul's suggestion is that multiple target rules behave differently for pattern vs. non-pattern rules.
For pattern rules, what Paul said is 100% correct, and should solve your problem. However, if you write a rule that says: foo.o foo.hi: foo.c ... It means something quite different. That means that the same rule builds both foo.c and foo.hi. In parallel build, that might cause make to run the rule twice. What I'm also interested in is why .SECONDARY made everything slow. Shachar -- Shachar Shemesh
_______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make