~ 1 min read

Compiling single kernel module

share this story on
How to compile a Linux kernel module without needing to resort to a full Linux kernel compilation process

We sometimes find ourselves in the need to compile just one module, and not the entire set of modules under the tree.

The Makefile that is present in the dir of the module you wish to compile should read obj-m := module.o Run make -C /usr/src/linux-headers-2.6.XX-YY-ZZZ/ SUBDIRS=$PWD modules

Compiliation should be successful and you should see the binary objects in the current dir now.

Reference: http://lwn.net/Articles/21835/

share this story on