How to compile a kernel module?
Posted: Mon 10 Jul 2017, 16:01
I need to start somewhere on a fairly mysterious and complex topic.
#1. I just need to recompile a single kernel module for Linux.
#2. I have all the source files I need and there is a Makefile and KConfig files in the directory.
#3. If I go to that directory and type the command: make thefile.ko, I get an error:
make: *** No rule to make target 'thefile.ko'. Stop.
So then there is no real recipes in there to convert .c/.asm files into their .o or .ko counterparts. Firstly, why? And secondly, what needs to be done to get those rules in there?
If there is a document or readme that describes this, please point me to it. But numerous Linux distros have this style of make and the files are quite similar.
Any help appreciated.
#1. I just need to recompile a single kernel module for Linux.
#2. I have all the source files I need and there is a Makefile and KConfig files in the directory.
#3. If I go to that directory and type the command: make thefile.ko, I get an error:
make: *** No rule to make target 'thefile.ko'. Stop.
So then there is no real recipes in there to convert .c/.asm files into their .o or .ko counterparts. Firstly, why? And secondly, what needs to be done to get those rules in there?
If there is a document or readme that describes this, please point me to it. But numerous Linux distros have this style of make and the files are quite similar.
Any help appreciated.