linux 内核模块makefile通用模板
ifneq ($(KERNELRELEASE),)
# 在 mylist 后面添加需要编译的模块数量 mylist=hello.o a.o
# 为每一个模块添加所需的文件 hello-objs := main.o a.o b.o
a-objs:= a.o
obj-m:=$(mylist) else #generate the path CURRENT_PATH:=$(shell pwd) #the absolute path LINUX_KERNEL_PATH:=/lib/modules/$(shell uname -r)/build #complie object default: make -C $(LINUX_KERNEL_PATH) M=$(CURRENT_PATH) modules clean: make -C $(LINUX_KERNEL_PATH) M=$(CURRENT_PATH) clean endif
如果说我的文章对你有用,只不过是我站在巨人的肩膀上再继续努力罢了。
若在页首无特别声明,本篇文章由 Schips 经过整理后发布。
博客地址:https://www.cnblogs.com/schips/
若在页首无特别声明,本篇文章由 Schips 经过整理后发布。
博客地址:https://www.cnblogs.com/schips/