forked from adnanpri/legion-wmi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (35 loc) · 824 Bytes
/
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
obj-m := legion-wmi.o
KVER := $(shell uname -r)
KDIR := /lib/modules/$(KVER)/build
PWD := $(shell pwd)
INSTALL := install
SYMBOL_FILE := Module.symvers
EXTRA_CFLAGS += -O2
ccflags-y += -D__CHECK_ENDIAN__
#
.PHONY: default
default:
$(MAKE) -C $(KDIR) M=$(PWD) modules
.PHONY: clean
clean:
$(MAKE) -C $(KDIR) M=$(PWD) clean
#
.PHONY: modules_install
modules_install:
$(INSTALL) -d /lib/modules/$(KVER)/drivers/platform/x86/
$(INSTALL) -m 644 legion-wmi.ko /lib/modules/$(KVER)/drivers/platform/x86/
.PHONY: install
install: modules_install
depmod -A
modprobe legion-wmi
#
.PHONY: modules_uninstall
modules_uninstall:
rm -f /lib/modules/$(KVER)/drivers/platform/x86/legion-wmi.ko
.PHONY: uninstall
uninstall: modules_uninstall
modprobe -r legion-wmi
depmod -A
#
.PHONY: purge
purge: uninstall clean