Hi every one
Can anyone please help me in Compiling a Kernel module for 2.6
any where iam not able to get a clear idea of the compilation n about writing Makefile .
Please help me out
Printable View
Hi every one
Can anyone please help me in Compiling a Kernel module for 2.6
any where iam not able to get a clear idea of the compilation n about writing Makefile .
Please help me out
here is the sample Makefile:
---------------------
obj-m += test.o # test.c is the source of your module.
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
$(MAKE) -C $(KDIR) M=$(PWD) modules
---------------------
if your module has multiple source files test1.c and test2.c and you need 1 module test
then you will have:
obj-m = test.o
test-objs = test1.o test2.o
Nice place to start:
http://www.faqs.org/docs/kernel/
obj-m += test.o
test-objs += test1.o test2.o
(My bad)