ifneq ($(KERNELRELEASE),)
EXTRA_CFLAGS += -DDEBUG
else
PWD := $(shell pwd)
KVER := $(shell uname -r)
KDIR := /lib/modules/$(KVER)/build
all:
..........
..........
..........
.........
EXTRA_CFLAGS += -DDEBUG
else
PWD := $(shell pwd)
KVER := $(shell uname -r)
KDIR := /lib/modules/$(KVER)/build
all:
$(MAKE) -C $(KDIR) M=$(PWD) modules
clean:
rm -rf *.o *.mod.c *.mod.o *.ko *.symvers *.order *.a
endif
modify kernel module make file in source code directory.
and execute make in source code directory.
need to copy *.ko to directory
/lib/modules/$(KVER)/kernel/***
and restart system.
本文介绍了一种针对内核模块Makefile的修改方法,并详细解释了如何通过make命令进行编译,最后需要将生成的.ko文件复制到指定目录并重启系统。
821

被折叠的 条评论
为什么被折叠?



