I created a small hello world module for programming
make -C /lib/modules/2.6.32-24-generic/build M=/home/bond/rrr modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.32-24-generic'
make[1]: *** No rule to make target `rrr'. Stop.
make[1]: Leaving directory `/usr/src/linux-headers-2.6.32-24-generic'
make: *** [build] Error 2
what could be the error
following is Makefile
ifeq ($(KERNELRELEASE),)
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
.PHONY: build clean
build:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
clean:
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c
rm -rf modules.order Module.symvers
else
$(info Building with KERNELRELEASE =${KERNELRELEASE})
obj-m := program.o
endif
and following is the program
/* Necessary includes for device drivers */
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h> /* printk() */
static int bond_init(void)
{
printk(KERN_ALERT "Hello, world\n");
return 0;
}
static void bond_exit(void)
{
printk (KERN_ALERT "Good by cruel world\n");
}
module_init(bond_init);
module_exit(bond_exit);
MODULE_AUTHOR("bond");
MODULE_LICENSE("GPL");