Quote:
Originally Posted by coopstah13 So you just need to know how to create a make file that will build a kernel module? You want to generate this makefile automatically or manually? The link in my previous post will show you how to create a make file that will compile a kernel module. If you need to automate this, you will need to look into using some kind of configure script, I'm sure there are many tutorials you can find on configure scripts by searching google. | I got the makefile working but I couldn't compile 2 or more source codes.
I have 2 files named nothing.c and hello.c
Here's my current makefile: Code: obj-m := test.o
module-objs := nothing.o hello.o
default:
make -C /lib/modules/`uname -r`/build M=`pwd` modules
I wanted to produce a kernel module named test.ko but it produces this error:
make -C /lib/modules/`uname -r`/build M=`pwd` modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.28-15-generic'
make[2]: *** No rule to make target `/home/rba1988/Desktop/test.c', needed by `/home/rba1988/Desktop/test.o'. Stop.
make[1]: *** [_module_/home/rba1988/Desktop] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.28-15-generic'
make: *** [default] Error 2 |