makefile

来自「linux下利用usb转换为串口的驱动」· 代码 · 共 47 行

TXT
47
字号
# Kernel includes.  Please avoid
# using '/usr/include' unless all
# other options exhausted.
#
KINCLUDES=/usr/src/linux/include

# uncomment line below if you have SMP
#SMPFLAGS=	-D__SMP__ -DCONFIG_SMP=1

# Unless you have a 386/486, you shouldn't need
# to change anything below here...

CPUFLAGS=	-DCPU=586 -march=i586
MODULE=		pl2303
CC=		gcc

KERNFLAGS=	\
	-D__KERNEL__ -I$(KINCLUDES) $(CPUFLAGS) $(SMPFLAGS) \
	-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \
	-fno-strict-aliasing -pipe -DMODULE

EXTRA_CFLAGS= -DEXPORT_SYMTAB

# DBGCFLAGS = -DDEBUG -DUSB_SERIAL_DEBUG

CFLAGS=		$(KERNFLAGS) $(DBGCFLAGS)


all::		$(MODULE).o usbserial.o

$(MODULE).o:	$(MODULE).c usb-serial.h
	$(CC) $(CFLAGS) -c $<

usbserial.o: usbserial.c usb-serial.h
	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c $<

inst:
	insmod ./usbserial.o
	insmod ./pl2303.o

uninst:
	rmmod pl2303
	rmmod usbserial

clean:
	rm -f *.o

⌨️ 快捷键说明

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