# How to build FreeBSD kernel faster than the previous builds



## jr.santhoshkumar (Apr 1, 2019)

I was making change in kernel code, and I build a kernel with following command
 $ make buildkernel installkernel
for each time, it was taking 20 mins
But I have made change in a single file, even though it was taking more time

Please can anyone give me the solution to build kernel faster


----------



## George (Apr 1, 2019)

I added the NO_MODULES="yes" option to make buildkernel, as I didnt modify any modules.
Generally, you can see available options in make.conf(5).


----------



## SirDice (Apr 1, 2019)

You can add `-DNO_CLEAN`, that should help.


```
NO_CLEAN               If set, no object tree files are cleaned at all.
                            This is the default when WITH_META_MODE is used
                            with filemon(4) loaded.  See src.conf(5) for more
                            details.  Setting NO_CLEAN implies NO_KERNELCLEAN,
                            so when NO_CLEAN is set no kernel objects are
                            cleaned either.
```
See build(7).


----------



## mast07 (Apr 1, 2019)

There actually is a dedicated option:

```
KERNFAST          If set, the build    target buildkernel defaults to setting
              NO_KERNELCLEAN, NO_KERNELCONFIG, and NO_KERNELOBJ.  When
              set to a value other than    1 then KERNCONF    is set to the
              value of KERNFAST.
```
See build(7)


----------

