-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
46 lines (34 loc) · 1.18 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
obj-$(CONFIG_RTL8XXXU) += rtl8xxxu.o
rtl8xxxu-y := rtl8xxxu_core.o rtl8xxxu_8192e.o rtl8xxxu_8723b.o \
rtl8xxxu_8723a.o rtl8xxxu_8192c.o
KVER := $(shell uname -r)
KSRC := /lib/modules/$(KVER)/build
MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/realtek/rtl8xxxu
all: modules
modules:
$(MAKE) -C $(KSRC) M=$(shell pwd) modules
MODULE_NAME = rtl8xxxu
install: modules
gzip -f $(MODULE_NAME).ko
sudo cp -f $(MODULE_NAME).ko.gz $(MODDESTDIR)
sudo /sbin/depmod -a ${KVER}
sudo modprobe $(MODULE_NAME) # do harmless modprobe first to ensure rmmod will not fail. This avoids an early exit
sudo rmmod $(MODULE_NAME)
sudo modprobe $(MODULE_NAME)
uninstall:
sudo rm -f $(MODDESTDIR)/$(MODULE_NAME).ko
sudo /sbin/depmod -a ${KVER}
.PHONY: modules clean
clean:
rm -fr *.ko.gz
cd hal ; rm -fr *.mod.c *.mod *.o .*.cmd */*.ko
cd core ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
cd os_dep ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
cd platform ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
rm -fr Module.symvers ; rm -fr Module.markers ; rm -fr modules.order
rm -fr *.mod.c *.mod *.o .*.cmd *.ko *~
rm -fr .tmp_versions
rm:
sudo rmmod $(MODULE_NAME)
probe:
sudo modprobe $(MODULE_NAME)