linux_module_learn/hellow/Makefile

14 lines
224 B
Makefile
Raw Normal View History

2023-07-22 13:42:32 +08:00
ifneq ($(KERNELRELEASE),)
obj-m := hello.o
else
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
endif
clean:
rm -r ./hello.o
rm -r ./hello.ko