Reputation: 2709
I write a hello.c:
#include <linux/init.h>
#include <linux/moudle.h>
static int hello_init(void)
{
printk(KERN_ALERT "Hello, World\n");
return 0;
}
static void hello_exit(void)
{
printk(KERN_ALERT "GoodBye, cruel Workd!\n");
}
module_init(hello_init);
module_exit(hello_exit);
module_LICENSE("GPL");
module_AUTHOR("ChangZhi");
And this is Makefile:
obj-m := hello.o
KERNEL_DIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
make -C $(KERNEL_DIR) SUBDIRS=$(PWD) modules
#clean:
#rm *.o *.ko *.mod.c
.PHONY:clean
when I run make
, the shell displays make: Nothing to be done for
default'.`. Could someone help me? Thanks a lot !
Upvotes: 3
Views: 17358
Reputation: 25885
As per ymonad says you require TAB
before make -C
default:
make -C $(KERNEL_DIR) SUBDIRS=$(PWD) modules
Upvotes: 4