# Compile kernel module with modified object file



## andrewschools (Feb 26, 2018)

I'm not sure if this is the right forum for this sort of question.  If not, forgive me.

I made a change to this file: /usr/src/sys/modules/usb/usb/ng_lookup.c and have ran a 
	
	



```
make
```
 which produces many object files.  The one I am concerned with is /usr/src/sys/modules/usb/usb/usb_lookup.o.  Now I want to recompile this module /usr/src/netgraph/bluetooth/drivers/ubt/ng_ubt.c with the new object file.  Is there any easy way to do this using the current make files?  Is there any standard practice or development setup I should use?  I have compiled /usr/src/netgraph/bluetooth/drivers/ubt/ng_ubt.c and loaded the module into the kernel but it doesn't look like it was compiled with my new object file.

Thanks!


----------



## ShelLuser (Feb 26, 2018)

The best place to find those answers is in the developers handbook,  Still, to my knowledge there are no shortcuts here, you'll need to build the entire kernel.


----------



## Maelstorm (Feb 26, 2018)

Although not recommended, you could add the following lines to your /etc/make.conf file:

```
# Kernel
NO_KERNELCLEAN=1
NO_KERNCLEAN=1

# World
NO_CLEAN=1
```
This will only rebuild the parts of the world/kernel that have been updated or changed without going through the entire build process.


----------



## andrewschools (Feb 27, 2018)

Thanks everyone.  I ended up re-compiling the kernel and that loaded in my changes


----------

