-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
67 lines (50 loc) · 1.19 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
SHELL := /bin/bash
LF_KERNEL := lf_kernel
LF_TCP_KERNERL := lf_tcp_kernel
LF_NETFILTER_KERNERL := lf_netfilter_kernel
LF_LIB := liblf
SHARED_DIR := /usr/local/lib
.PHONY: test lib
all:
make clean
make module
make lib
make test
module:
-@mkdir build
@cp -Rf datapath build
@cp -Rf include build
@cd build/datapath; make all;
lib:
-@mkdir build
@cp -Rf lib build
@cp -Rf include build
@cd build/lib; make all;
test:
-@mkdir build
@cp -Rf test build
@cp -Rf include build
@cd build/test; make all;
module_install:
@cd build/datapath; sudo insmod $(LF_KERNEL).ko
module_remove:
sudo rmmod $(LF_KERNEL)
lib_install:
make lib
sudo cp build/lib/${LF_LIB}.so ${SHARED_DIR}
sudo ldconfig
lib_remove:
sudo rm -rf ${SHARED_DIR}/${LF_LIB}.so
sudo ldconfig
tcp_kernel_install:
@cd build/datapath; sudo insmod $(LF_TCP_KERNERL).ko
sudo sysctl net.ipv4.tcp_congestion_control=lf_tcp_kernel
tcp_kernel_remove:
sudo sysctl net.ipv4.tcp_congestion_control=cubic
sudo rmmod $(LF_TCP_KERNERL)
netfilter_kernel_install:
@cd build/datapath; sudo insmod $(LF_NETFILTER_KERNERL).ko
netfilter_kernel_remove:
sudo rmmod $(LF_NETFILTER_KERNERL)
clean:
-@rm -rf build