forked from BeardOverflow/msi-ec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
69 lines (50 loc) · 1.43 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
VERSION := 0.08
DKMS_ROOT_PATH := /usr/src/msi_ec-$(VERSION)
TARGET ?= $(shell uname -r)
ccflags-y := -std=gnu11 -Wno-declaration-after-statement
obj-m += msi-ec.o
all: modules
older-kernel-patch:
git apply older-kernel.patch
modules:
@$(MAKE) -C /lib/modules/$(TARGET)/build M=$(CURDIR) modules
clean:
@$(MAKE) -C /lib/modules/$(TARGET)/build M=$(CURDIR) clean
load:
insmod msi-ec.ko
load-debug:
insmod msi-ec.ko debug=1
unload:
-rmmod msi-ec
reload: unload load
reload-debug: unload load-debug
install:
mkdir -p /lib/modules/$(TARGET)/extra
cp msi-ec.ko /lib/modules/$(TARGET)/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/$(TARGET)/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)/ec_memory_configuration.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