模块文件
#include
#include
static int hello_init()
{
printk(KERN_ALERT "HELLO\n");
return 0;
}
static int hello_exit()
{
printk(KERN_ALERT "GOOD BYE\n");
return 0;
}
module_init(hello_init);
module_exit(hello_exit);
makefile文件
ifeq ($(KERNELRELEASE),)
KD ?= /usr/src/linux-headers-2.6.35-22-gernic
PWD ?= $(shell pwd)
modules:
make -C $(KD) M= $(PWD) modules
modules_install:
make -C $(KD) M= $(PWD) modules_install
clean:
rm *.o
else
obj-m:=hello.o
endif
错误信息为
makefile:4:***command commence before first target.stop
请问这是为什么,我是照着书打上来的啊,而且也没发现什么错……


Ubuntu_LW 于 2013-01-21 19:14:05发表:
看不懂
haiyanmao_linux 于 2013-01-18 10:07:35发表:
??始?,貌似也不懂
于 2013-01-10 14:30:31发表:
modules:
make -C $(KD) M= $(PWD) modules
modules_install:
make -C $(KD) M= $(PWD) modules_install
这样
于 2013-01-10 14:29:13发表:
在makefile命令下要有加上他tab键
tonylee2012 于 2012-07-16 17:01:45发表:
刚开始学
紫梦 于 2012-07-16 12:51:21发表:
难
Junyi 于 2012-07-16 11:30:18发表:
这linux基础好不简单