- Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
Latest commit
16 lines (11 loc) · 574 Bytes
/
Copy pathMakefile
File metadata and controls
16 lines (11 loc) · 574 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
ifneq ($(KERNELRELEASE),) #第二次make执行路径,KERNELRELEASE内核源码Makefile中定义的变量,第一次make(手动)时,未定义
obj-m += module_refcount.o
else #第一次make执行路径
PWD := $(shell pwd)
KVER := $(shell uname -r)
KDIR := /lib/modules/$(KVER)/build
all:
$(MAKE) -C $(KDIR) M=$(PWD)#第二次make,读取KDIR中的Makefile(读到KERNELRELEASE定义),然后返回PWD,此时KERNELRELEASE已定义
clean:
rm -rf *.o *.mod.c *.ko *.symvers *.order *.markers *~
endif