关于最简单的驱动的makefile
我自己按照参考写了个最简单的驱动,可是makefile提示Nothing to be done for `modules'.
驱动和makefile如下:
hello.c:
1 #include<linux/module.h>
2 #include<linux/kernel.h>
3 #include<linux/init.h>
4
5 MODULE_LICENCE("Dual BSD/GPL");
6
7 static int hello_init(void)
8 {
9 printk(KERN_INFO "hello world\n");
10 return 0;
11 }
12
13 static void hello_exit(void)
14 {
15 printk(KERN_INFO "goodbye hello\n");
16 }
17
18 module_init(hello_init);
19 module_exit(hello_exit);
makefile:
1 obj-m := hello.o
2 KERNELDIR := /lib/modules/2.6.32-21-generic/bulid
3 PWD := $(shell pwd)
4
5 modules:
6 $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
7
8 modules_install:
9 $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
做了一段时间的应用以后驱动的问题有些遗忘~该如何处理?