Hi All, I had taken a simple module from http://www-128.ibm.com/developerworks/linux/library/l-proc.html shown below. The simple-lkm.c file looks as follows #include <linux/module.h> /* Defines the license for this LKM */ MODULE_LICENSE("GPL"); /* Init function called on module entry */ int my_module_init( void ) { printk(KERN_INFO "my_module_init called. Module is now loaded.\n"); return 0; } /* Cleanup function called on module exit */ void my_module_cleanup( void ) { printk(KERN_INFO "my_module_cleanup called. Module is now unloaded.\n"); return; } /* Declare entry and exit functions */ module_init( my_module_init ); module_exit( my_module_cleanup ); My Makefile looks as follows obj-m += simple-lkm.o To build the module I had used the following command make -C /usr/src/linux-`uname -r` SUBDIRS=$PWD modules I got the following ouput(error). make: Entering directory `/usr/src/linux-2.4.20-8' make -r -f tmp_include_depends all make[1]: Entering directory `/usr/src/linux-2.4.20-8' make[1]: Circular /usr/src/linux-2.4.20-8/include/asm/smplock.h <- /usr/src/linux-2.4.20-8/include/linux/interrupt.h dependency dropped. make[1]: Circular /usr/src/linux-2.4.20-8/include/linux/netfilter_ipv4/ip_conntrack.h <- /usr/src/linux-2.4.20-8/include/linux/netfilter_ipv4/ip_conntrack_helper.h dependency dropped. make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/usr/src/linux-2.4.20-8' make -C /home/NTEK-APPL/FILESYSTEM/new/simple CFLAGS="-D__KERNEL__ -I/usr/src/linux-2.4.20-8/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=i686 -DMODULE -DMODVERSIONS -include /usr/src/linux-2.4.20-8/include/linux/modversions.h" MAKING_MODULES=1 modules make[1]: Entering directory `/home/NTEK-APPL/FILESYSTEM/new/simple' make[1]: *** No rule to make target `modules'. Stop. make[1]: Leaving directory `/home/NTEK-APPL/FILESYSTEM/new/simple' make: *** [_mod_/home/NTEK-APPL/FILESYSTEM/new/simple] Error 2 make: Leaving directory `/usr/src/linux-2.4.20-8' Can any one tell me what is the error in this case. I think it is makefile error but I am not able to unserstand what is that error. I had attached the code which I downloaded from above mentioned site. Thanks Manjunath
Attachment:
l-proc-lkm.tar.gz
Description: GNU Zip compressed data