-
Notifications
You must be signed in to change notification settings - Fork 70
/
Makefile
44 lines (31 loc) · 868 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
KERNEL_RELEASE ?= $(shell uname -r)
KERNEL_DIR ?= /lib/modules/$(KERNEL_RELEASE)/build
DKMS_TARBALL ?= dkms.tar.gz
TAR ?= tar
obj-m += brutal.o
ccflags-y := -std=gnu99
.PHONY: all clean load unload
.PHONY: .always-make
all:
$(MAKE) -C $(KERNEL_DIR) M=$(PWD) modules
clean: clean-dkms.conf clean-dkms-tarball
$(MAKE) -C $(KERNEL_DIR) M=$(PWD) clean
load:
sudo insmod brutal.ko
unload:
sudo rmmod brutal
.PHONY: dkms-tarball clean-dkms-tarball clean-dkms.conf
.always.make:
dkms.conf: ./scripts/mkdkmsconf.sh .always-make
./scripts/mkdkmsconf.sh > dkms.conf
clean-dkms.conf:
$(RM) dkms.conf
$(DKMS_TARBALL): dkms.conf Makefile brutal.c
$(TAR) zcf $(DKMS_TARBALL) \
--transform 's,^,./dkms_source_tree/,' \
dkms.conf \
Makefile \
brutal.c
dkms-tarball: $(DKMS_TARBALL)
clean-dkms-tarball:
$(RM) $(DKMS_TARBALL)