Needed to compile my first kernel program

Please Help needed to compile my first kernel program

I have compile & install new kernel 2.6.32.3 on path: /root/linux2.6.32.3/
I have written small program [shown below] at path: /root/abc/

I already compile & install kernel 2.6.32.3 on fedora 10 machine & check /boot/grub/menu1.st entry it is there.

My program giving an error when I "make"
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

uname: extra operand `.r'
Try `uname --help' for more information.
uname: extra operand `.r'
Try `uname --help' for more information.
make: Nothing to be done for `all'.


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

My Kernel Program

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
/*
* hello.1.c . The simplest kernel module.
*/
#include </root/linux-2.6.32.3/include/linux/module.h> /* Needed by all modules */
#include </root/linux-2.6.32.3/include/linux/kernel.h> /* Needed for KERN_INFO */

int init_module(void)
{
printk(KERN_INFO "Hello world 1.\n");
/*
* A non 0 return means init_module failed; module can't be loaded.
*/
return 0;
}

void cleanup_module(void)
{
printk(KERN_INFO "Goodbye world 1.\n");
}

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Makefile look like

obj.m += hello.1.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

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++~
myemail id : rachilmeth@googlemail.com
That makefile should contain $(shell uname -r) not $(shell uname .r)
Topic archived. No new replies allowed.