- 论坛徽章:
- 0
|
这个驱动项目有若干个文件夹
比如 1\1.c
2\2.c
3\3_1.c ,3_2.c
这样一个结构如何套用2.6的驱动Makefile模板呢?- ifneq ($(KERNELRELEASE),)
- # call from kernel build system
- scull-objs := demo1.o demo2.o
- obj-m := demo.o
- else
- CROSS_COMPILE ?=powerpc
- KERNELLIBDIR=/lib
- KERNELDIR ?= /linux-2.6.25_minifo
- PWD := $(shell pwd)
- all:
- $(MAKE) CROSS_COMPILE=$(CROSS_COMPILE) ARCH=powerpc -C $(KERNELDIR) M=$(PWD) modules
- clean:
- rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions
- endif
- depend .depend dep:
- $(CC) $(CFLAGS) -M *.c > .depend
- ifeq (.depend,$(wildcard .depend))
- include .depend
- endif
复制代码 |
|