📄 makefile
字号:
# set your module name here# provide the following files## MODULENAME.c the driver# MODULENAME.h the include file# MODULENAME_test.c the driver test program# MODULENAME_test.sh the driver test script#MODULENAME := mmap### should not need to change stuff below ######################KDIR := /lib/modules/$(shell uname -r)/build#KDIR := /exports/linux-2.6.12.2/PWD := $(shell pwd)CC := gcc -Wallifeq ($(KERNELRELEASE),)all: $(MODULENAME)_testall: $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) moduleselse obj-m := $(MODULENAME).oendif$(MODULENAME)_test: $(MODULENAME)_test.c $(CC) -g -o $(MODULENAME)_test $(MODULENAME)_test.cload: insmod ./$(MODULENAME).kounload: rmmod $(MODULENAME)test: all ./$(MODULENAME)_test.shclean: rm -f *.o *.ko Modules.symvers *.mod.c .*.cmd $(MODULENAME)_test
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -