1 ifeq ($(KERNELRELEASE),)
2 CURRENT_PATH=$(shell pwd)
3 #KERNEL_DIR:=/lib/modules/$(shell uname -r)/build/
4 KERNEL_DIR:=/lib/modules/$(shell uname -r)/build
5 default:
6 make -C $(KERNEL_DIR) M=$(CURRENT_PATH) modules
7 install:
8 insmod hello.ko
9 uninstall:
10 rmmod hello.ko
11 clean:
12 make -C $(KERNEL_DIR) M=$(CURRENT_PATH) clean
13 else
14 modules-objs:=hello.o
15 obj-m:=hello.o
16 endif
时间: 2024-12-20 00:58:16