-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
56 lines (42 loc) · 1.23 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
VERSION := 0.08
DKMS_ROOT_PATH := /usr/src/msi_ec-$(VERSION)
obj-m += msi-ec.o
all: modules
modules:
@$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(CURDIR) modules
clean:
@$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(CURDIR) clean
load:
insmod msi-ec.ko
unload:
-rmmod msi-ec
install:
mkdir -p /lib/modules/$(shell uname -r)/extra
cp msi-ec.ko /lib/modules/$(shell uname -r)/extra
depmod -a
echo msi-ec > /etc/modules-load.d/msi-ec.conf
modprobe -v msi-ec
uninstall:
-modprobe -rv msi-ec
rm -f /lib/modules/$(shell uname -r)/extra/msi-ec.ko
depmod -a
rm -f /etc/modules-load.d/msi-ec.conf
dkms-install:
dkms --version >> /dev/null
mkdir -p $(DKMS_ROOT_PATH)
cp $(CURDIR)/dkms.conf $(DKMS_ROOT_PATH)
cp $(CURDIR)/Makefile $(DKMS_ROOT_PATH)
cp $(CURDIR)/msi-ec.c $(DKMS_ROOT_PATH)
cp $(CURDIR)/constants.h $(DKMS_ROOT_PATH)
sed -e "s/@CFLGS@/${MCFLAGS}/" \
-e "s/@VERSION@/$(VERSION)/" \
-i $(DKMS_ROOT_PATH)/dkms.conf
dkms add msi_ec/$(VERSION)
dkms build msi_ec/$(VERSION)
dkms install msi_ec/$(VERSION)
echo msi-ec > /etc/modules-load.d/msi-ec.conf
dkms-uninstall:
dkms remove msi_ec/$(VERSION) --all
rm -rf $(DKMS_ROOT_PATH)
rm -f /etc/modules-load.d/msi-ec.conf
dev: modules unload load