I think you can follow the official guide source.android.com/source/building-kernels to create your own kernel, and then move the binary (zImage) to device/lge/mako-kernel/ (this path for Nexus 4) in Android source code. This will replace the default kernel file.
Of course, you need to change the path, which depends on your device.
Finally, build AOSP as usual.
source share