Re: Suggestions request for speed-up kernel compilation

From: Sam Ravnborg
Date: Fri Apr 24 2009 - 06:36:39 EST


On Fri, Apr 24, 2009 at 11:57:35AM +0200, Alessio Igor Bogani wrote:
> Hi All,
>
> Sorry for my bad English.
>
> I'm a kernel newbie and I would be very happy to receive some tips
> about kernel compilation from experienced developers.
>
> I have recently elaborated some trivial patches. For each one I have
> done a build test at minimum and I find myself spend a lot of time
> waiting my Core Duo to accomplish this task. Make is a very smart tool
> but after a git pull or a git fetch origin/git reset --hard origin it
> can't help as desired.
>
> Unfortunately I don't have a clustered compilation farm under my control. :-)
>
> Anyone can suggest me how mitigate that issue?
The kernel build system does a good job detecting what to build.
So if you touches a .h file or you change a CONFIG_ symbol used by
a header file you will see a lot of rebuilds - sometimes
more than you expected.

Try to do:

make V=2

to see why a certain file is rebuild.


If you know you only have to build a single file you can use:

make kernel/foo.o

If you want to build a directory - including sub-directories:

make kernel/

If you want to build a specific module use:

make drivers/net/foobar.ko

make help can give you a few more hints.

And try to avoid "make clean" / "make mrproper" - as this deletes all .o files.

Sam
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/