📄 makefile
字号:
# Comment/uncomment the following line to disable/enable debugging#非常标准的Makefile,稍加修改就可以用在很多驱动上#将这个开关打开,看proc的输出。在这个例子分别有二个用于输出的proc文件。一个是用老方法实现的#/proc/scullmem#新方法 /proc/scullseqDEBUG = 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)CFLAGS += -I$(LDDINC)ifneq ($(KERNELRELEASE),)# call from kernel build systemscull-objs := main.o pipe.o access.oobj-m := scull.oelseKERNELDIR ?= /lib/modules/$(shell uname -r)/buildPWD := $(shell pwd)modules: $(MAKE) -C $(KERNELDIR) M=$(PWD) LDDINC=$(PWD)/../include modulesendifclean: rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versionsdepend .depend dep: $(CC) $(CFLAGS) -M *.c > .dependifeq (.depend,$(wildcard .depend))include .dependendif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -