makefile

来自「典型的linux驱动程序」· 代码 · 共 44 行

TXT
44
字号
# Comment/uncomment the following line to disable/enable debugging#DEBUG = 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 + =
减小字号Ctrl + -
显示快捷键?