读书人

linux device drive 第六章代码示范-s

发布时间: 2012-11-26 11:48:50 作者: rapoo

linux device drive 第六章代码示例-scullpipe的实验(poll和fasync方法的实现)之一

一 scullpipe的代码

1 scull.h

KERNELDIR = /home/tekkaman/working/SBC2440/linux-2.6.22.2    # The current directory is passed to sub-makes as argumentPWD := $(shell pwd)INSTALLDIR = /home/tekkaman/working/rootfs/lib/modulesCROSS_COMPILE=/home/tekkaman/working/crosstool-gcc410-k26222/gcc-4.1.0-glibc-2.3.2/arm-9tdmi-linux-gnu/bin/arm-9tdmi-linux-gnu-CC= $(CROSS_COMPILE)gcc# Comment/uncomment the following line to disable/enable debuggingDEBUG = y# Add your debugging flag (or not) to CFLAGSifeq ($(DEBUG),y)  DEBFLAGS = -O -g -DSCULL_DEBUG # "-O" is needed to expand inlineselse  DEBFLAGS = -O2endifCFLAGS += $(DEBFLAGS)obj-m := pipe.o modules:$(MAKE) -C $(KERNELDIR) M=$(PWD) modulesmodules_install:cp pipe.ko $(INSTALLDIR)clean:rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions.PHONY: modules modules_install clean


1

读书人网 >UNIXLINUX

热点推荐