PC机上的:
1.obj-m := hello.o
2.KERNELDIR := /lib/modules/$(shell uname -r)/build
3.default:
4. make -C $(KERNELDIR) M=$(shell pwd) modules
5.install:
6. insmod hello.ko
7.uninstall:
8. rmmod hello.ko
9.clean:
10. make -C $(KERNELDIR) M=$(shell pwd) clean
ARM上的:
1.obj-m := hello.o
2.KERNELDIR :=/opt/friendlyARMQQ2440/ghCodes/kernel-2.6.13 #对应到自己开发板得内核目录
3.default:
4. make -C $(KERNELDIR) M=$(shell pwd) modules
5.install:
6. insmod hello.ko #www.linuxidc.com
7.uninstall:
8. rmmod hello.ko
9.clean:
10. make -C $(KERNELDIR) M=$(shell pwd) clean
两者的区别仅仅在内核目录上.