makefile

来自「LINUX设备驱动程序第二版配套源码 ldd2-samples-1.0.1」· 代码 · 共 60 行

TXT
60
字号
# Comment/uncomment the following line to enable/disable debugging#DEBUG = y# This Makefile has been simplified as much as possible, by putting all# generic material, independent of this specific directory, into# ../Rules.make. Read that file for detailsTOPDIR  := $(shell cd ..; pwd)include $(TOPDIR)/Rules.make# Add your debugging flag (or not) to CFLAGSifeq ($(DEBUG),y)  DEBFLAGS = -O -g -DJIT_DEBUG -DJIQ_DEBUG -DALL_DEBUGelse  DEBFLAGS = -O2endifCFLAGS += $(DEBFLAGS) -I..GENKSYMS = /sbin/genksymsifdef CONFIG_SMP	GENKSYMS += -p smp_endifOBJS = faulty.o sleepy.o silly.o slave.o slaveD.o slaveH.o import.o \	master.o export.o hello.o \	jit.o jiq.o inter.o \	kdatasize.o kdataalign.oSRC = $(OBJS:.o:.c)# if compiling a partial list, use a different list of objectsifdef LDD_PARTIAL        OBJS = hello.o faulty.o sleepy.o jit.o jiq.o kdatasize.o kdataalign.oendifall: $(OBJS)clean:	rm -f *.o *.ver *~ # Don't use -Wall here: the code is silly by designhello.o: hello.c	$(CC) -D__KERNEL__ -I$(INCLUDEDIR) -c $^ -o $@#FIXME: the 2.4.0 below is plain wrong :)ifdef CONFIG_MODVERSIONSexport.o import.o: export.verendifexport.ver: export.c	$(CC) -I$(INCLUDEDIR) $(CFLAGS) -E -D__GENKSYMS__ $^ | \		$(GENKSYMS) -k 2.4.0 > $@

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?