-
Notifications
You must be signed in to change notification settings - Fork 62
/
Makefile
87 lines (68 loc) · 1.95 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
kdbus$(EXT)-y := \
bus.o \
connection.o \
endpoint.o \
fs.o \
handle.o \
item.o \
main.o \
match.o \
message.o \
metadata.o \
names.o \
node.o \
notify.o \
domain.o \
policy.o \
pool.o \
queue.o \
reply.o \
util.o
obj-m += kdbus$(EXT).o
KERNELVER ?= $(shell uname -r)
KERNELDIR ?= /lib/modules/$(KERNELVER)/build
PWD := $(shell pwd)
all: module tools test samples docs
tools::
$(MAKE) -C tools KERNELDIR=$(realpath $(KERNELDIR)) KBUILD_MODNAME=kdbus$(EXT)
test::
$(MAKE) -C test KERNELDIR=$(realpath $(KERNELDIR)) KBUILD_MODNAME=kdbus$(EXT)
samples::
$(MAKE) -C samples KERNELDIR=$(realpath $(KERNELDIR)) KBUILD_MODNAME=kdbus$(EXT)
module:
$(MAKE) -C $(KERNELDIR) M=$(PWD)
clean:
rm -f *.o *~ core .depend .*.cmd *.ko *.mod.c
rm -f Module.markers Module.symvers modules.order
rm -rf .tmp_versions Modules.symvers $(hostprogs-y)
$(MAKE) -C doc clean
$(MAKE) -C test clean
check:
test/kdbus-test
mandocs:
$(MAKE) -C doc mandocs
htmldocs:
$(MAKE) -C doc htmldocs
docs: mandocs htmldocs
kerneldoc_check:
$(KERNELDIR)/scripts/kernel-doc *.c kdbus.h >/dev/null | grep "^Warning"
install: module
mkdir -p /lib/modules/$(KERNELVER)/kernel/ipc/kdbus$(EXT)/
cp -f kdbus$(EXT).ko /lib/modules/$(KERNELVER)/kernel/ipc/kdbus$(EXT)/
depmod $(KERNELVER)
uninstall:
rm -f /lib/modules/$(KERNELVER)/kernel/ipc/kdbus/kdbus$(EXT).ko
rm -f /lib/modules/$(KERNELVER)/kernel/drivers/kdbus/kdbus$(EXT).ko
rm -f /lib/modules/$(KERNELVER)/kernel/drivers/misc/kdbus/kdbus$(EXT).ko
coccicheck:
$(MAKE) -C $(KERNELDIR) M=$(PWD) coccicheck
tt-prepare: module test
-sudo sh -c 'dmesg -c > /dev/null'
-sudo umount /sys/fs/kdbus$(EXT)
-sudo sh -c 'rmmod kdbus$(EXT)'
sudo sh -c 'insmod kdbus$(EXT).ko attach_flags_mask=0xffffffffffffffff'
sudo mount -t kdbus$(EXT)fs kdbus$(EXT)fs /sys/fs/kdbus$(EXT)
tt: tt-prepare
test/kdbus-test -m kdbus$(EXT) ; (R=$$? ; dmesg ; exit $$R)
stt: tt-prepare
sudo test/kdbus-test -m kdbus$(EXT) ; (R=$$? ; dmesg ; exit $$R)