On Sat, Feb 23, 2013 at 01:50:38PM +0000, Ian Lynagh wrote: > On Fri, Feb 22, 2013 at 09:38:22PM -0500, 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? > > We wrote this part of the build system some time ago, and didn't write > down the reason
Oh, I tell a lie, just found the comment: # So you might # think a more correct way is to change the .hs rule: # # %.hi %.o : %.hs # $(HC) ... # # this says "compiling %.hs updates both %.hi and %.o", but that's not # true, since compiling the .hs file might not update the .hi file, if # the .hi file didn't change. And if we use this version, then make # will keep trying to rebuild %.hi if it is out of date with respect # to %.hs. Thanks Ian _______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make