forked from lwfinger/rtw88
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
178 lines (144 loc) · 4.62 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
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/rtw88
else
MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/rtw88
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
ifeq ("","$(wildcard MOK.der)")
NO_SKIP_SIGN := y
endif
EXTRA_CFLAGS += -O2
EXTRA_CFLAGS += -DCONFIG_RTW88_8822BE=1
EXTRA_CFLAGS += -DCONFIG_RTW88_8821CE=1
EXTRA_CFLAGS += -DCONFIG_RTW88_8822CE=1
EXTRA_CFLAGS += -DCONFIG_RTW88_8723DE=1
EXTRA_CFLAGS += -DCONFIG_RTW88_DEBUG=1
EXTRA_CFLAGS += -DCONFIG_RTW88_DEBUGFS=1
#EXTRA_CFLAGS += -DCONFIG_RTW88_REGD_USER_REG_HINTS
obj-m += rtw_core.o
rtw_core-objs += main.o \
mac80211.o \
util.o \
debug.o \
tx.o \
rx.o \
mac.o \
phy.o \
coex.o \
efuse.o \
fw.o \
ps.o \
sec.o \
wow.o \
bf.o \
regd.o \
sar.o
obj-m += rtw_8822b.o
rtw_8822b-objs := rtw8822b.o rtw8822b_table.o
obj-m += rtw_8822be.o
rtw_8822be-objs := rtw8822be.o
obj-m += rtw_8822bu.o
rtw_8822bu-objs := rtw8822bu.o
obj-m += rtw_8822bs.o
rtw_8822bs-objs := rtw8822bs.o
obj-m += rtw_8822c.o
rtw_8822c-objs := rtw8822c.o rtw8822c_table.o
obj-m += rtw_8822ce.o
rtw_8822ce-objs := rtw8822ce.o
obj-m += rtw_8822cu.o
rtw_8822cu-objs := rtw8822cu.o
obj-m += rtw_8822cs.o
rtw_8822cs-objs := rtw8822cs.o
obj-m += rtw_8723d.o
rtw_8723d-objs := rtw8723d.o rtw8723d_table.o
obj-m += rtw_8723de.o
rtw_8723de-objs := rtw8723de.o
obj-m += rtw_8723du.o
rtw_8723du-objs := rtw8723du.o
obj-m += rtw_8723ds.o
rtw_8723ds-objs := rtw8723ds.o
obj-m += rtw_8821c.o
rtw_8821c-objs := rtw8821c.o rtw8821c_table.o
obj-m += rtw_8821ce.o
rtw_8821ce-objs := rtw8821ce.o
obj-m += rtw_8821cs.o
rtw_8821cs-objs := rtw8821cs.o
obj-m += rtw_8821cu.o
rtw_8821cu-objs := rtw8821cu.o
obj-m += rtw_pci.o
rtw_pci-objs := pci.o
obj-m += rtw_sdio.o
rtw_sdio-objs := sdio.o
obj-m += rtw_usb.o
rtw_usb-objs := usb.o
obj-m += rtw_usb.o
rtw_usb-objs := usb.o
ccflags-y += -D__CHECK_ENDIAN__
all:
$(MAKE) -C $(KSRC) M=$(PWD) modules
install: all
@mkdir -p $(MODDESTDIR)
@install -p -D -m 644 *.ko $(MODDESTDIR)
@#copy firmware images to target folder
@mkdir -p $(FIRMWAREDIR)/rtw88/
@cp -f *.bin $(FIRMWAREDIR)/rtw88/
ifeq ($(COMPRESS_GZIP), y)
@gzip -f $(MODDESTDIR)/*.ko
endif
ifeq ($(COMPRESS_XZ), y)
@xz -f $(MODDESTDIR)/*.ko
endif
@depmod -a $(KVER)
@echo "Install rtw88 SUCCESS"
uninstall:
@modprobe -r rtw_8822be
@modprobe -r rtw_8822ce
@modprobe -r rtw_8723de
@rm -f $(MODDESTDIR)/rtw_*.ko
@depmod -a
@echo "Uninstall rtw88 SUCCESS"
clean:
@rm -fr *.mod.c *.mod *.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:
ifeq ($(NO_SKIP_SIGN), y)
@openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=Custom MOK/"
@mokutil --import MOK.der
else
echo "Skipping key creation"
endif
@$(KSRC)/scripts/sign-file sha256 MOK.priv MOK.der rtw_pci.ko
@$(KSRC)/scripts/sign-file sha256 MOK.priv MOK.der rtw_core.ko
@$(KSRC)/scripts/sign-file sha256 MOK.priv MOK.der rtw_8723d.ko
@$(KSRC)/scripts/sign-file sha256 MOK.priv MOK.der rtw_8723de.ko
@$(KSRC)/scripts/sign-file sha256 MOK.priv MOK.der rtw_8822b.ko
@$(KSRC)/scripts/sign-file sha256 MOK.priv MOK.der rtw_8822be.ko
@$(KSRC)/scripts/sign-file sha256 MOK.priv MOK.der rtw_8822bu.ko
@$(KSRC)/scripts/sign-file sha256 MOK.priv MOK.der rtw_8822bs.ko
@$(KSRC)/scripts/sign-file sha256 MOK.priv MOK.der rtw_8821c.ko
@$(KSRC)/scripts/sign-file sha256 MOK.priv MOK.der rtw_8821ce.ko
@$(KSRC)/scripts/sign-file sha256 MOK.priv MOK.der rtw_8821cu.ko
@$(KSRC)/scripts/sign-file sha256 MOK.priv MOK.der rtw_8821cs.ko
@$(KSRC)/scripts/sign-file sha256 MOK.priv MOK.der rtw_8822c.ko
@$(KSRC)/scripts/sign-file sha256 MOK.priv MOK.der rtw_8822ce.ko
@$(KSRC)/scripts/sign-file sha256 MOK.priv MOK.der rtw_8822cu.ko
@$(KSRC)/scripts/sign-file sha256 MOK.priv MOK.der rtw_8822cs.ko
sign-install: all sign install