以下是我的模块的代码:
#include<linux/modules.h> //needed by all modules
#include<linux/kernel.h> //neede for kern_info
int init_module(void) //initialisation module
{
printk(KERN_INFO "Hello world1 \n");
return 0; //non zero return means the initialisation was not successful
}
void cleanup_module(void)
{
printk(KERN_INFO "Good Bye \n");
}
下面是Makefile:
obj−m += kernel.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
当我尝试运行make命令时出现错误“***没有规则使目标`-C'。停止。”
请帮助。