For developing kernel extensions to use with regular OSX kernels, you shouldn't be using a self-compiled kernel, but use the Kernel.framework that Apple supplies with Xcode and the bundled OS X SDK. If you're using Xcode for your build process anyway, the easiest way is to use one of the kext target templates (I/O Kit driver or generic kext) to set up the build system and include the kernel.framework.
If you have an existing Xcode project to which you want to add a kext build, open it and create a new target, then choose one of the kext templates under "system plugin". You get the same choice when you create a new project altogether.
As for choosing between the two templates:
- Generic kext is mainly useful if your userspace application will explicitly load the kext.
- I/O kit kexts can be loaded automatically on device hotplug or on system boot, so they are usually the most useful if your kext doesn't have some kind of userspace trigger.