Subject: Re: cleandir parallel make race
To: Patrick Welche <prlw1@newn.cam.ac.uk>
From: David Laight <david@l8s.co.uk>
List: port-i386
Date: 01/05/2006 20:39:04
On Tue, Jan 03, 2006 at 06:43:32PM +0000, Patrick Welche wrote:
> Cleandir fails for me with current with
> 
> --- cleandir-dosboot ---
> getcwd() failed: No such file or directory
> 
> Essentially, this is because the Makefiles of dosboot, netboot and
> pxeboot all include Makefile.booters. Makefile.booters includes
> the makefiles for libkern, libz, libsa and libi386, which means
> that those last 4 directories get cleaned 3 times (by dosboot,
> netboot, pxeboot). When doing a parallel build who knows who will
> get there first..
> 
> I'm not sure what the best fix is.. .WAIT would mean that building
> couldn't happen in parallel, but I think it can, it is just the
> cleaning which can't, or rather, the error which should be ignored..
> 
> Thoughts?

rm -rf $(OBJ)

I guess that only one of those needs to recurse into the (common)
library object tree....
(or recurse in from the outer level instead)

It is possible that the building doesn't work correctly in parallel either.

Those makefiles are all a bit of a fudge to avoid building the libraries
umpteen times, while still allowing a make in any of the subdirectories
to work.

	David

-- 
David Laight: david@l8s.co.uk