Error while doing make and no idea about the error
This is in my Makefile content
obj-m += hello.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
*************************************************************************
The content in my hello.c
Please help me ASAP.
#include<linux/module.h>
#include<linux/init.h>
#include <linux/kernel.h>
int my_init(void)
{
printk("Hello world \n");
return 0;
}
void my_cleanup(void)
{
printk("Goodbye world \n");
}
module_init(my_init);
module_exit(my_cleanup);
**************************************************************************
rajesh@rajesh-Inspiron-N5110:~/raja/dev_drivers$ ls
char_dev hello.c Makefile module.mod.c modules.order Module.symvers
rajesh@rajesh-Inspiron-N5110:~/raja/dev_drivers$ sudo make
[sudo] password for rajesh:
make -C /lib/modules/2.6.35-22-generic/build M= modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.35-22-generic'
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[2]: *** No rule to make target `kernel/bounds.c', needed by `kernel/bounds.s'. Stop.
make[1]: *** [prepare0] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.35-22-generic'
make: *** [all] Error 2
Last edited by rpittala; 01-28-2012 at 02:27 AM.
|