# Is it possible to make the kernel incrementally?



## Anonymous (Nov 29, 2012)

I am experimenting with some kernel source changes, and I am looking for a way of compiling and linking the changes only. make buildkernel takes more than a hour, since it deletes and rebuilds also all the un-touched parts. I am looking for a much much quicker coding/compiling/testing cycle when working on kernel sources.

How can this be achieved?


----------



## ondra_knezour (Nov 29, 2012)

What about ccache?


----------



## Anonymous (Nov 29, 2012)

ondra_knezour said:
			
		

> What about ccache?



ccache(1)() looks for me like the absolute overkill for something that could be a simple Makefile target, so, I am still looking for something like make _kernel_without_cleaning_all_the_objects_before. If this does not exist, then I would give devel/ccache a try.


----------



## jb_fvwm2 (Nov 29, 2012)

make -DNO_CLEAN -DNOCLEAN # unsure which works
One may be warned if you buildworld (unsure about buildkernel) that way, installworld will fail unless also invoked with the same parameters (here recently at least.) And I'm not entirely sure it entirely does what it purports to, but probably.


----------



## Anonymous (Nov 30, 2012)

Thank you jb_fvwm2. You put me on the right track.

The switch for kernel builds is actually -DNO_KERNELCLEAN. However, even better is -DKERNFAST which expands to
-DNO_KERNELCONFIG -DNO_KERNELCLEAN -DNO_KERNELDEPEND -DNO_KERNELOBJ

This perfectly solved the issue:


```
make buildkernel -DKERNFAST KERNCONF=EXPERIMENTAL
```


----------

