forked from gregkh/kdbus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (49 loc) · 1.24 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
kdbus$(EXT)-y := \
bus.o \
connection.o \
endpoint.o \
handle.o \
main.o \
match.o \
message.o \
metadata.o \
names.o \
notify.o \
domain.o \
policy.o \
pool.o \
queue.o \
util.o
obj-m += kdbus$(EXT).o
KERNELVER ?= $(shell uname -r)
KERNELDIR ?= /lib/modules/$(KERNELVER)/build
PWD := $(shell pwd)
all: module tools test
tools::
$(MAKE) -C tools KERNELDIR=$(realpath $(KERNELDIR)) KBUILD_MODNAME=kdbus$(EXT)
test::
$(MAKE) -C test 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 test clean
check:
test/kdbus-test
install: module
mkdir -p /lib/modules/$(KERNELVER)/kernel/drivers/kdbus$(EXT)/
cp -f kdbus$(EXT).ko /lib/modules/$(KERNELVER)/kernel/drivers/kdbus$(EXT)/
depmod $(KERNELVER)
uninstall:
rm -f /lib/modules/$(KERNELVER)/kernel/drivers/kdbus/kdbus$(EXT).ko
coccicheck:
$(MAKE) -C $(KERNELDIR) M=$(PWD) coccicheck
tt: all
sudo sh -c 'dmesg -c > /dev/null'
-sudo sh -c 'rmmod kdbus$(EXT)'
sudo sh -c 'insmod kdbus$(EXT).ko'
-sudo sh -c 'sync; umount / 2> /dev/null'
test/kdbus-test
dmesg