bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Infinite loop bug with parallel make


From: Ian Lynagh
Subject: Re: Infinite loop bug with parallel make
Date: Sat, 23 Feb 2013 15:20:35 +0000
User-agent: Mutt/1.5.20 (2009-06-14)

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]