-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
125 lines (103 loc) · 2.57 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
##############################################################################
#
# Build
#
.PHONY: build
build: external
@[ -f "build/build.ninja" ] || cmake -B build -G Ninja -DUSE_TRACE=ON \
-DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-gdwarf-4 -g3 -DJBUF_STAT -DRE_RTP_PCAP"
@cmake --build build --parallel
.PHONY: webui
webui:
cd webui && npm install && npm run build-only
rm -Rf webui/dist/avatars
rm -Rf webui/dist/download
mkdir -p webui/public/avatars
ln -s ../public/avatars webui/dist/
ln -s ../public/download webui/dist/
.PHONY: release
release: external
make clean
cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_FLAGS="-g -DJBUF_STAT"
make build
.PHONY: systemd
systemd: external
make clean
cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_FLAGS="-g -DJBUF_STAT" -DUSE_SD_SOCK=ON
make build
.PHONY: unix
unix: external
make clean
cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_FLAGS="-g -DJBUF_STAT" -DUSE_UNIX_SOCK=ON
make build
external:
mkdir -p external
git clone --depth 1 \
https://github.com/baresip/re.git external/re
git clone --depth 1 -b playout_time \
https://github.com/baresip/baresip.git external/baresip
cd external/re && \
patch -p1 < ../../patches/re_aubuf_timestamp_order_fix.patch
##############################################################################
#
# Sanitizers
#
.PHONY: run_san
run_san:
ASAN_OPTIONS=fast_unwind_on_malloc=0 \
# TSAN_OPTIONS="suppressions=tsan.supp" \
make run
.PHONY: asan
asan:
make clean
cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS="-fsanitize=undefined,address \
-fno-omit-frame-pointer" \
-DHAVE_THREADS=
make build
.PHONY: tsan
tsan:
make clean
cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS="-fsanitize=undefined,thread \
-fno-omit-frame-pointer" \
-DHAVE_THREADS=
make build
##############################################################################
#
# Helpers
#
.PHONY: cloc
cloc:
cloc --exclude-dir='node_modules,external,build,env' --exclude-ext='json' .
.PHONY: update
update: external
cd external/re && git pull
cd external/rem && git pull
cd external/baresip && git pull
.PHONY: avatars
avatars:
mkdir -p webui/public/avatars
.PHONY: run
run: build avatars
build/slmix -c config_example
.PHONY: gdb
gdb: build avatars
gdb --args build/slmix -c config_example
.PHONY: clean
clean:
rm -Rf build
.PHONY: cleaner
cleaner: clean
rm -Rf external
.PHONY: fresh
fresh: clean build
.PHONY: ccheck
ccheck:
tests/ccheck.py src modules
.PHONY: test
test: build
cd tests/bdd && env/bin/behave