forked from lwfinger/rtl8192du
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
182 lines (135 loc) · 4.11 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
178
179
180
181
EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS)
EXTRA_CFLAGS += -O1
EXTRA_CFLAGS += -Wno-unused-variable
EXTRA_CFLAGS += -Wno-unused-value
EXTRA_CFLAGS += -Wno-unused-label
EXTRA_CFLAGS += -Wno-unused-parameter
EXTRA_CFLAGS += -Wno-unused-function
EXTRA_CFLAGS += -Wno-unused
EXTRA_CFLAGS += -Wno-uninitialized
EXTRA_CFLAGS += -I$(src)/include
CONFIG_AUTOCFG_CP = n
CONFIG_POWER_SAVING = y
CONFIG_USB_AUTOSUSPEND = n
CONFIG_HW_PWRP_DETECTION = n
CONFIG_WIFI_TEST = n
CONFIG_BT_COEXISTENCE = n
CONFIG_WAKE_ON_WLAN = n
CONFIG_DRVEXT_MODULE = n
export TopDIR ?= $(shell pwd)
ccflags-y += -D__CHECK_ENDIAN__
RTL871X = rtl8192d
MODULE_NAME = rtl8192du
CHIP_FILES := \
hal/$(RTL871X)_xmit.o
HCI_NAME = usb
_OS_INTFS_FILES := os_dep/osdep_service.o \
os_dep/os_intfs.o \
os_dep/$(HCI_NAME)_intf.o \
os_dep/$(HCI_NAME)_ops_linux.o \
os_dep/ioctl_linux.o \
os_dep/xmit_linux.o \
os_dep/mlme_linux.o \
os_dep/recv_linux.o \
os_dep/ioctl_cfg80211.o \
os_dep/rtw_android.o
_HAL_INTFS_FILES := hal/hal_intf.o \
hal/hal_com.o \
hal/$(RTL871X)_hal_init.o \
hal/$(RTL871X)_phycfg.o \
hal/$(RTL871X)_rf6052.o \
hal/$(RTL871X)_dm.o \
hal/$(RTL871X)_rxdesc.o \
hal/$(RTL871X)_cmd.o \
hal/$(HCI_NAME)_halinit.o \
hal/$(MODULE_NAME)_led.o \
hal/$(MODULE_NAME)_xmit.o \
hal/$(MODULE_NAME)_recv.o \
hal/hal8192duhwimg.o
_HAL_INTFS_FILES += hal/$(HCI_NAME)_ops_linux.o
_HAL_INTFS_FILES += $(CHIP_FILES)
ifeq ($(CONFIG_AUTOCFG_CP), y)
$(shell cp $(TopDIR)/autoconf_$(RTL871X)_$(HCI_NAME)_linux.h $(TopDIR)/include/autoconf.h)
endif
ifeq ($(CONFIG_USB_AUTOSUSPEND), y)
EXTRA_CFLAGS += -DCONFIG_USB_AUTOSUSPEND
endif
ifeq ($(CONFIG_POWER_SAVING), y)
EXTRA_CFLAGS += -DCONFIG_POWER_SAVING
endif
ifeq ($(CONFIG_HW_PWRP_DETECTION), y)
EXTRA_CFLAGS += -DCONFIG_HW_PWRP_DETECTION
endif
ifeq ($(CONFIG_WIFI_TEST), y)
EXTRA_CFLAGS += -DCONFIG_WIFI_TEST
endif
ifeq ($(CONFIG_BT_COEXISTENCE), y)
EXTRA_CFLAGS += -DCONFIG_BT_COEXISTENCE
endif
ifeq ($(CONFIG_WAKE_ON_WLAN), y)
EXTRA_CFLAGS += -DCONFIG_WAKE_ON_WLAN
endif
SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ | sed -e s/ppc/powerpc/)
ARCH ?= $(SUBARCH)
CROSS_COMPILE ?=
KVER := $(shell uname -r)
KSRC := /lib/modules/$(KVER)/build
MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/
INSTALL_PREFIX :=
ifneq ($(USER_MODULE_NAME),)
MODULE_NAME := $(USER_MODULE_NAME)
endif
ifneq ($(KERNELRELEASE),)
rtk_core := core/rtw_cmd.o \
core/rtw_security.o \
core/rtw_debug.o \
core/rtw_io.o \
core/rtw_ioctl_set.o \
core/rtw_ieee80211.o \
core/rtw_mlme.o \
core/rtw_mlme_ext.o \
core/rtw_wlan_util.o \
core/rtw_pwrctrl.o \
core/rtw_rf.o \
core/rtw_recv.o \
core/rtw_sta_mgt.o \
core/rtw_ap.o \
core/rtw_xmit.o \
core/rtw_p2p.o \
core/rtw_sreset.o
$(MODULE_NAME)-y += $(rtk_core)
$(MODULE_NAME)-y += core/rtw_efuse.o
$(MODULE_NAME)-y += $(_HAL_INTFS_FILES)
$(MODULE_NAME)-y += $(_OS_INTFS_FILES)
obj-$(CONFIG_RTL8192DU) := $(MODULE_NAME).o
else
export CONFIG_RTL8192DU = m
all: modules
modules:
$(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KSRC) M=$(shell pwd) modules
strip:
$(CROSS_COMPILE)strip $(MODULE_NAME).ko --strip-unneeded
install:
install -d $(DESTDIR)$(INSTALL_PREFIX)$(MODDESTDIR)
install -m644 $(MODULE_NAME).ko $(DESTDIR)$(INSTALL_PREFIX)$(MODDESTDIR)
install -d $(DESTDIR)$(INSTALL_PREFIX)/lib/firmware/rtlwifi
install -m644 rtl8192dufw.bin $(DESTDIR)$(INSTALL_PREFIX)/lib/firmware/rtlwifi
install -m644 rtl8192dufw_wol.bin $(DESTDIR)$(INSTALL_PREFIX)/lib/firmware/rtlwifi
depmod -a
uninstall:
rm -f $(DESTDIR)$(INSTALL_PREFIX)$(MODDESTDIR)/$(MODULE_NAME).ko
rm -f $(DESTDIR)$(INSTALL_PREFIX)/lib/firmware/rtlwifi/rtl8192dufw.bin
rm -f $(DESTDIR)$(INSTALL_PREFIX)/lib/firmware/rtlwifi/rtl8192dufw_wol.bin
depmod -a
config_r:
@echo "make config"
/bin/bash script/Configure script/config.in
.PHONY: modules clean
clean:
rm -fr *.mod.c *.mod *.o .*.cmd *.ko *~
rm .tmp_versions -fr ; rm Module.symvers -fr
rm -fr Module.markers ; rm -fr modules.order
cd core ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
cd hal ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
cd os_dep ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
endif