forked from lwfinger/rtw89
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
93 lines (78 loc) · 2.09 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
SHELL := /bin/sh
KVER ?= $(shell uname -r)
KSRC := /lib/modules/$(KVER)/build
FIRMWAREDIR := /lib/firmware/
PWD := $(shell pwd)
CLR_MODULE_FILES := *.mod.c *.mod *.o .*.cmd *.ko *~ .tmp_versions* modules.order Module.symvers
SYMBOL_FILE := Module.symvers
# Handle the move of the entire rtw88 tree
ifneq ("","$(wildcard /lib/modules/$(KVER)/kernel/drivers/net/wireless/realtek)")
MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/realtek/rtw89
else
MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/rtw89
endif
#Handle the compression option for modules in 3.18+
ifneq ("","$(wildcard $(MODDESTDIR)/*.ko.gz)")
COMPRESS_GZIP := y
endif
ifneq ("","$(wildcard $(MODDESTDIR)/*.ko.xz)")
COMPRESS_XZ := y
endif
MOK_KEY_DIR ?= /var/lib/shim-signed/mok
EXTRA_CFLAGS += -O2
EXTRA_CFLAGS += -DCONFIG_RTW89_DEBUGMSG
EXTRA_CFLAGS += -DCONFIG_RTW89_DEBUGFS
obj-m += rtw89core.o
rtw89core-y += core.o \
debug.o \
mac80211.o \
mac.o \
phy.o \
fw.o \
rtw8852a.o \
rtw8852a_table.o \
rtw8852a_rfk.o \
rtw8852a_rfk_table.o \
cam.o \
efuse.o \
regd.o \
coex.o \
ps.o \
sar.o \
ser.o \
util.o
obj-m += rtw89pci.o
rtw89pci-y := pci.o
ccflags-y += -D__CHECK_ENDIAN__
.PHONY: all install uninstall clean sign sign-install
all:
$(MAKE) -C $(KSRC) M=$(PWD) modules
install: all
@rm -f $(MODDESTDIR)/rtw89*.ko
@mkdir -p $(MODDESTDIR)
@install -p -D -m 644 *.ko $(MODDESTDIR)
ifeq ($(COMPRESS_GZIP), y)
@gzip -f $(MODDESTDIR)/*.ko
endif
ifeq ($(COMPRESS_XZ), y)
@xz -f $(MODDESTDIR)/*.ko
endif
@depmod -a $(KVER)
@mkdir -p /lib/firmware/rtw89/
cp *.bin /lib/firmware/rtw89/.
@echo "Install rtw89 SUCCESS"
uninstall:
@rm -f $(MODDESTDIR)/rtw89.ko
@depmod -a
@echo "Uninstall rtw89 SUCCESS"
clean:
@rm -fr *.mod.c *.mod *.o .*.cmd .*.o.cmd *.ko *~ .*.o.d .cache.mk
@rm -fr .tmp_versions
@rm -fr Modules.symvers
@rm -fr Module.symvers
@rm -fr Module.markers
@rm -fr modules.order
sign:
kmodsign sha512 $(MOK_KEY_DIR)/MOK.priv $(MOK_KEY_DIR)/MOK.der rtw89core.ko
kmodsign sha512 $(MOK_KEY_DIR)/MOK.priv $(MOK_KEY_DIR)/MOK.der rtw89pci.ko
sign-install: all sign install