-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (32 loc) · 976 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
45
46
47
48
CURRENT_PATH = $(shell pwd)
LINUX_KERNEL = $(shell uname -r)
RULES_FILENAME = 71-aosv-ipc.rules
MODULE_FILENAME = ipc_module
LINUX_KERNEL_PATH = /lib/modules/$(LINUX_KERNEL)/build/
obj-m += ipc_module.o
ipc_module-objs := ipc_module_main.o ipc_group_root.o ipc_group.o
CFLAGS+="-DKERNELSPACE"
all:
make -C $(LINUX_KERNEL_PATH) M=$(CURRENT_PATH) modules
test: ipc_lib.c
gcc -o test test.c ipc_lib.c -pthread
run:
/bin/sh $(CURRENT_PATH)/test
clean:
make -C $(LINUX_KERNEL_PATH) M=$(CURRENT_PATH) clean
install:
sudo groupadd aosv_ipc
sudo adduser $(USER) aosv_ipc
cp $(CURRENT_PATH)/$(RULES_FILENAME) /etc/udev/rules.d/
sudo udevadm control --reload-rules && udevadm trigger
uninstall:
sudo groupdel aosv_ipc
rm /etc/udev/rules.d/$(RULES_FILENAME)
sudo udevadm control --reload-rules && udevadm trigger
insert:
insmod $(MODULE_FILENAME).ko
remove:
rmmod $(MODULE_FILENAME)
reinsert:
rmmod $(MODULE_FILENAME)
insmod $(MODULE_FILENAME).ko