[U-Boot] [PATCH] Allow for parallel builds and saved output

Kumar Gala galak at kernel.crashing.org
Tue Nov 8 14:48:33 CET 2011


On Nov 3, 2011, at 11:22 AM, Simon Glass wrote:

> Hi Andy,
> 
> On Thu, Nov 3, 2011 at 12:28 AM, Andy Fleming <afleming at freescale.com> wrote:
>> The MAKEALL script cleverly runs make with the appropriate options
>> to use all of the cores on the system, but your average U-Boot build
>> can't make much use of more than a few cores.  If you happen to have
>> a many-core server, your builds will leave most of the system idle.
>> 
>> In order to make full use of such a system, we need to build multiple
>> targets in parallel, and this requires directing make output into
>> multiple directories. We add a BUILD_NBUILDS variable, which allows
>> users to specify how many builds to run in parallel. I've found that
>> 16 is too many on my system (fork starts to fail). When BUILD_NBUILDS
>> is set greater than 1, we redefine BUILD_DIR for each build to be
>> ${BUILD_DIR}/${target}. Also, we make "./build" the default BUILD_DIR
>> when BUILD_NBUILDS is greater than 1.
>> 
>> Once each build finishes, we run make clean on its directory, to reduce
>> the footprint, and also remove all .depend files.
>> 
>> As a result, we are left with a build directory with all of the built
>> targets still there for use, which means anyone who wanted to use
>> MAKEALL as part of a test harness can now do so.
>> 
>> Signed-off-by: Andy Fleming <afleming at freescale.com>
>> ---
>> Inspired by all the MAKEALL improvements, I decided to clean up my old
>> one for parallel builds. I think this version addresses the concerns
>> raised last time...
> 

I see an issue if I have a build in working tree already.  I think we might need a distclean before starting

I also it seems this does things in clumps of BUILD_NBUILDS.  What I mean is, if BUILD_NBUILDS is 4, you do 4 and wait for all 4 to finish before starting the 5th job once the 1st is complete.  Anything we can do about that to always try and have 4 builds going until the end?

- k


More information about the U-Boot mailing list