summarylogtreecommitdiffstats
path: root/Makefile
blob: 67704620ec8786e7a68aa8f597e071d671546b68 (plain)
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
modname := hid-ft260
obj-m := $(modname).o

KVERSION := $(shell uname -r)
KDIR := /lib/modules/$(KVERSION)/build
PWD := "$$(pwd)"

ifdef DEBUG
CFLAGS_$(obj-m) := -DDEBUG
endif

default:
	$(MAKE) -C $(KDIR) M=$(PWD) modules

clean:
	$(MAKE) O=$(PWD) -C $(KDIR) M=$(PWD) clean

load:
	-rmmod $(modname)
	insmod $(modname).ko

install:
	install -m 0755 -o root -g root $(modname).ko /lib/modules/$(KVERSION)/updates/drivers/hid/$(modname)
	depmod -a

uninstall:
	rm /lib/modules/$(KVERSION)/updates/drivers/hid/$(modname)/$(modname).ko
	rmdir /lib/modules/$(KVERSION)/updates/drivers/hid/$(modname)
	rmdir /lib/modules/$(KVERSION)/updates/drivers/hid
	depmod -a