i am trying to compile a simple module hello-1.c

#include <linux/init.h>
#include <linux/module.h>
MODULE_LICENSE("Dual BSD/GPL");
static int hello_init(void)
{
    printk(KERN_ALERT "Hello, world\n");
    return 0;
}
static void hello_exit(void)
{
    printk(KERN_ALERT "Goodbye, cruel world\n");
}
module_init(hello_init);
module_exit(hello_exit);




Makefile:

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




on make i get the following:

[r...@localhost Desktop]# 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'.



i just want hello world printed and when i do lsmod i want to see my module

Reply via email to