-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
49 lines (40 loc) · 1.15 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
##################################### Driver compile Makefile ##########################################################
#
#Author : harryyue
#
#Modify : 2017-01-09
#
#Update :
#
#########################################################################################################################
#If module verification failed,please set CONFIG_MODULE_SIG=n
#kvm: module verification failed: signature and/or required key missing - tainting kernel
#CONFIG_MODULE_SIG=n
KERNELDIR:=/lib/modules/$(shell uname -r)/build
SRC:=
APP:=
module:
make -C $(KERNELDIR) M=$(shell pwd) modules
# gcc $(APP).c -o $(APP)
ins:
@$(shell sudo insmod $(SRC).ko)
@$(sudo chmod 666 /dev/chrdev_driver1)
@sudo dmesg
@echo "<---------echo------------------------------------->"
@lsmod|head
rm:
@$(shell sudo rmmod $(SRC))
@sudo dmesg
@echo "<---------------------------------echo------------->"
@lsmod|head
test:
#@$(shell sudo chmod 666 /dev/chrdev_driver1ev_driver1)
#@$(shell ./$(APP))
#@sudo dmesg
clean:
@sudo dmesg -c
@sudo dmesg -c
rm -rf *.o module* Module* *.ko *.mod* $(APP)
@echo "<---------------------------------------------->"
@ls -l
obj-m=$(SRC).o