File: Makefile

package info (click to toggle)
rtpengine 13.5.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,676 kB
  • sloc: ansic: 86,764; perl: 59,422; python: 3,193; sh: 1,030; makefile: 693; asm: 211
file content (355 lines) | stat: -rw-r--r-- 13,947 bytes parent folder | download
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
TARGET=		all-tests

export top_srcdir = ..

include ../lib/deps.Makefile

with_transcoding ?= yes

ifeq ($(origin CFLAGS),undefined)
CFLAGS?=	-g -Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -Wstrict-prototypes -Werror=return-type \
		-Wshadow
else
CFLAGS:=	$(CFLAGS)
endif
PRELOAD_CFLAGS := $(CFLAGS)
CFLAGS+=	-pthread
CFLAGS+=	-std=c11
CFLAGS+=	-I. -I../lib/ -I../kernel-module/ -I../include/
CFLAGS+=	-D_GNU_SOURCE
CFLAGS+=	$(CFLAGS_GLIB)
CFLAGS+=	$(CFLAGS_GTHREAD)
CFLAGS+=	$(CFLAGS_OPENSSL)
CFLAGS+=	$(CFLAGS_LIBPCRE)
CFLAGS+=	$(CFLAGS_LIBCURL)
CFLAGS+=	$(CFLAGS_JSON_GLIB)
ifeq ($(with_transcoding),yes)
CFLAGS+=	$(CFLAGS_LIBAVCODEC)
CFLAGS+=	$(CFLAGS_LIBAVFORMAT)
CFLAGS+=	$(CFLAGS_LIBAVUTIL)
CFLAGS+=	$(CFLAGS_LIBSWRESAMPLE)
CFLAGS+=	$(CFLAGS_LIBAVFILTER)
CFLAGS+=	$(CFLAGS_SPANDSP)
CFLAGS+=	$(CFLAGS_OPUS)
CFLAGS+=	$(CFLAGS_LIBZ)
CFLAGS+=	$(CFLAGS_LIBWEBSOCKETS)
CFLAGS+=	$(CFLAGS_LIBEVENT)
CFLAGS+=	-DWITH_TRANSCODING
ifeq ($(RTPENGINE_EXTENDED_TESTS),1)
CFLAGS+=	-DWITH_AMR_TESTS
endif
CFLAGS+=	$(CFLAGS_MYSQL)
else
CFLAGS+=	-DWITHOUT_CODECLIB
endif

LDLIBS:=	-lm -ldl
LDLIBS+=	$(LDLIBS_GLIB)
LDLIBS+=	$(LDLIBS_GTHREAD)
LDLIBS+=	$(LDLIBS_LIBCRYPTO)
LDLIBS+=	$(LDLIBS_OPENSSL)
LDLIBS+=	$(LDLIBS_LIBPCRE)
LDLIBS+=	$(LDLIBS_LIBCURL)
LDLIBS+=	$(LDLIBS_JSON_GLIB)
ifeq ($(with_transcoding),yes)
LDLIBS+=	$(LDLIBS_LIBAVCODEC)
LDLIBS+=	$(LDLIBS_LIBAVFORMAT)
LDLIBS+=	$(LDLIBS_LIBAVUTIL)
LDLIBS+=	$(LDLIBS_LIBSWRESAMPLE)
LDLIBS+=	$(LDLIBS_LIBAVFILTER)
LDLIBS+=	$(LDLIBS_SPANDSP)
LDLIBS+=	$(LDLIBS_OPUS)
LDLIBS+=	$(LDLIBS_LIBZ)
LDLIBS+=	$(LDLIBS_LIBWEBSOCKETS)
LDLIBS+=	$(LDLIBS_LIBPCAP)
LDLIBS+=	$(LDLIBS_LIBEVENT)
LDLIBS+=	$(LDLIBS_LIBHIREDIS)
LDLIBS+=	$(LDLIBS_MYSQL)
endif

CFLAGS+=	$(CFLAGS_CODEC_CHAIN)
LDLIBS+=	$(LDLIBS_CODEC_CHAIN)

SRCS=		test-bitstr.c aes-crypt.c aead-aes-crypt.c test-const_str_hash.strhash.c aead-decrypt.c
LIBSRCS=	loglib.c auxlib.c str.c rtplib.c ssllib.c mix_buffer.c bufferpool.c bencode.c
DAEMONSRCS=	crypto.c ssrc.c helpers.c rtp.c cli.strhash.c

ifeq ($(with_transcoding),yes)
SRCS+=		test-transcode.c test-dtmf-detect.c test-payload-tracker.c test-resample.c test-stats.c
SRCS+=		spandsp_recv_fax_pcm.c spandsp_recv_fax_t38.c spandsp_send_fax_pcm.c \
		spandsp_send_fax_t38.c test-mix-buffer.c
ifeq ($(RTPENGINE_EXTENDED_TESTS),1)
SRCS+=		test-amr-decode.c test-amr-encode.c
endif
LIBSRCS+=	codeclib.strhash.c resample.c socket.c streambuf.c dtmflib.c poller.c
DAEMONSRCS+=	control_ng_flags_parser.c codec.c call.c ice.c kernel.c media_socket.c stun.c \
		dtls.c recording.c statistics.c rtcp.c redis.c iptables.c graphite.c \
		cookie_cache.c udp_listener.c homer.c load.c cdr.c dtmf.c timerthread.c \
		media_player.c jitter_buffer.c t38.c tcp_listener.c mqtt.c websocket.c \
		audio_player.c arena.c ng_client.c call_interfaces.strhash.c sdp.strhash.c \
		janus.strhash.c control_ng.strhash.c
LIBASM=		mvr2s_x64_avx2.S mvr2s_x64_avx512.S mix_in_x64_avx2.S mix_in_x64_avx512bw.S mix_in_x64_sse2.S
endif
ifneq ($(have_liburing),yes)
LIBSRCS+=	uring.c
endif

SRCS+=		s3-auth.c
LIBSRCS+=	s3utils.c

COMMONOBJS=	str.o auxlib.o rtplib.o loglib.o ssllib.o

include ../lib/common.Makefile

.PHONY:		all-tests unit-tests daemon-tests daemon-tests \
	daemon-tests-main daemon-tests-jb daemon-tests-dtx daemon-tests-dtx-cn daemon-tests-pubsub \
	daemon-tests-intfs daemon-tests-stats daemon-tests-delay-buffer daemon-tests-delay-timing \
	daemon-tests-evs daemon-tests-player-cache daemon-tests-redis daemon-tests-redis-json \
	daemon-tests-measure-rtp daemon-tests-mos-legacy daemon-tests-mos-fullband daemon-tests-config-file \
	daemon-tests-templ-def daemon-tests-templ-def-offer daemon-tests-t38 daemon-tests-evs-dtx \
	daemon-tests-transform daemon-tests-http daemon-tests-heuristic daemon-tests-asymmetric \
	daemon-tests-dtx-no-shift daemon-tests-rtcp daemon-tests-redis-subscribe

TESTS=		test-bitstr aes-crypt aead-aes-crypt test-const_str_hash.strhash
ifeq ($(with_transcoding),yes)
TESTS+=		test-transcode test-dtmf-detect test-payload-tracker test-resample test-stats test-mix-buffer
ifeq ($(RTPENGINE_EXTENDED_TESTS),1)
TESTS+=		test-amr-decode test-amr-encode
endif
endif
TESTS+=		s3-auth

ADD_CLEAN=	tests-preload.so time-fudge-preload.so $(TESTS) aead-decrypt
ADD_CLEAN+=	s3-auth

ifeq ($(with_transcoding),yes)
all-tests:	unit-tests daemon-tests
else
all-tests:	unit-tests
endif
	true # override linking recipe from common.Makefile

unit-tests:	$(TESTS) aead-decrypt
	failed="" ; \
	for x in $(TESTS); do \
	  echo `date +"%Y-%m-%d %H:%M:%S"` testing: $$x ; \
	  G_DEBUG=fatal-warnings ./$$x ; \
	  if [ $$? -eq 0 ] ; \
	    then echo `date +"%Y-%m-%d %H:%M:%S"` test $$x: succeeded ; \
	    else echo `date +"%Y-%m-%d %H:%M:%S"` test $$x: failed ; failed="$$failed $$x" ; \
	  fi ; \
	done ; \
	if [ -n "$$failed" ] ; then \
	  echo "Tests failed: $$failed" ; \
	  exit 1 ; \
	fi

daemon-tests: daemon-tests-main daemon-tests-jb daemon-tests-pubsub daemon-tests-websocket \
	daemon-tests-evs daemon-tests-async-tc \
	daemon-tests-audio-player daemon-tests-audio-player-play-media \
	daemon-tests-intfs daemon-tests-stats daemon-tests-player-cache daemon-tests-redis \
	daemon-tests-rtpp-flags daemon-tests-redis-json daemon-tests-measure-rtp daemon-tests-mos-legacy \
	daemon-tests-mos-fullband daemon-tests-config-file \
	daemon-tests-templ-def daemon-tests-templ-def-offer \
	daemon-tests-sdp-manipulations daemon-tests-sdes-manipulations \
	daemon-tests-sdp-orig-replacements daemon-tests-moh daemon-tests-evs-dtx daemon-tests-transform \
	daemon-tests-transcode-config daemon-tests-codec-prefs daemon-tests-http daemon-tests-heuristic \
	daemon-tests-asymmetric daemon-tests-rtcp daemon-tests-redis-subscribe

daemon-test-deps:	tests-preload.so
	$(MAKE) -C ../daemon

daemon-tests-main:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests.pl

daemon-tests-jb:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-jb.pl

daemon-tests-heuristic:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-heuristic.pl

daemon-tests-asymmetric:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-asymmetric.pl

daemon-tests-dtx:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-dtx.pl

daemon-tests-dtx-no-shift:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-dtx-no-shift.pl

daemon-tests-dtx-cn:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-dtx-cn.pl

daemon-tests-pubsub:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-pubsub.pl

daemon-tests-transform:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-transform.pl

daemon-tests-transcode-config:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-transcode-config.pl

daemon-tests-stats:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-stats.pl

daemon-tests-websocket:	daemon-test-deps
	./auto-test-helper "$@" python3 auto-daemon-tests-websocket.py

daemon-tests-intfs:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-intfs.pl

daemon-tests-delay-buffer:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-delay-buffer.pl

daemon-tests-delay-timing:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-delay-timing.pl

daemon-tests-evs:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-evs.pl

daemon-tests-player-cache:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-player-cache.pl

daemon-tests-redis:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-redis.pl

daemon-tests-redis-subscribe:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-redis-subscribe.pl

daemon-tests-redis-json:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-redis-json.pl

daemon-tests-audio-player:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-audio-player.pl

daemon-tests-audio-player-play-media:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-audio-player-play-media.pl

daemon-tests-rtpp-flags:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-rtpp-flags.pl

daemon-tests-unknown-fmtp:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-unknown-fmtp.pl

daemon-tests-sdp-manipulations:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-sdp-manipulations.pl

daemon-tests-sdes-manipulations:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-sdes-manipulations.pl

daemon-tests-sdp-orig-replacements:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-sdp-orig-replacements.pl

daemon-tests-moh:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-moh.pl

daemon-tests-async-tc:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-async-tc.pl

daemon-tests-measure-rtp:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-measure-rtp.pl

daemon-tests-mos-legacy:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-mos-legacy.pl

daemon-tests-mos-fullband:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-mos-fullband.pl

daemon-tests-config-file:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-config-file.pl

daemon-tests-templ-def-offer:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-templ-def-offer.pl

daemon-tests-templ-def:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-templ-def.pl

daemon-tests-t38:	daemon-test-deps spandsp_recv_fax_pcm spandsp_recv_fax_t38 \
			spandsp_send_fax_pcm spandsp_send_fax_t38
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-t38.pl

daemon-tests-evs-dtx:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-evs-dtx.pl

daemon-tests-codec-prefs:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-codec-prefs.pl

daemon-tests-http:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-http.pl

daemon-tests-rtcp:	daemon-test-deps
	./auto-test-helper "$@" perl -I../perl auto-daemon-tests-rtcp.pl

test-bitstr:	test-bitstr.o

test-mix-buffer:	test-mix-buffer.o $(COMMONOBJS) mix_buffer.o ssrc.o rtp.o crypto.o helpers.o \
	mix_in_x64_avx2.o mix_in_x64_sse2.o mix_in_x64_avx512bw.o codeclib.strhash.o dtmflib.o \
	mvr2s_x64_avx2.o mvr2s_x64_avx512.o resample.o bufferpool.o uring.o poller.o bencode.o

spandsp_send_fax_pcm:	spandsp_send_fax_pcm.o

spandsp_recv_fax_pcm:	spandsp_recv_fax_pcm.o

spandsp_send_fax_t38:	spandsp_send_fax_t38.o

spandsp_recv_fax_t38:	spandsp_recv_fax_t38.o

spandsp_raw_fax_tests: spandsp_send_fax_pcm spandsp_recv_fax_pcm spandsp_send_fax_t38 spandsp_recv_fax_t38

test-amr-decode: test-amr-decode.o $(COMMONOBJS) codeclib.strhash.o resample.o dtmflib.o resample.o \
	mvr2s_x64_avx2.o mvr2s_x64_avx512.o bencode.o

test-amr-encode: test-amr-encode.o $(COMMONOBJS) codeclib.strhash.o resample.o dtmflib.o \
	mvr2s_x64_avx2.o mvr2s_x64_avx512.o bencode.o

test-dtmf-detect: test-dtmf-detect.o

aes-crypt:	aes-crypt.o $(COMMONOBJS) crypto.o bencode.o

aead-decrypt:	aead-decrypt.o $(COMMONOBJS) crypto.o rtp.o bencode.o

aead-aes-crypt:	aead-aes-crypt.o $(COMMONOBJS) crypto.o bencode.o

test-stats:	test-stats.o $(COMMONOBJS) codeclib.strhash.o resample.o codec.o ssrc.o call.o ice.o helpers.o \
	kernel.o media_socket.o stun.o bencode.o socket.o poller.o dtls.o recording.o statistics.o \
	rtcp.o redis.o iptables.o graphite.o call_interfaces.strhash.o sdp.strhash.o rtp.o crypto.o \
	control_ng_flags_parser.o control_ng.strhash.o graphite.o \
	streambuf.o cookie_cache.o udp_listener.o homer.o load.o cdr.o dtmf.o timerthread.o \
	media_player.o jitter_buffer.o dtmflib.o t38.o tcp_listener.o mqtt.o janus.strhash.o \
	websocket.o cli.strhash.o mvr2s_x64_avx2.o mvr2s_x64_avx512.o audio_player.o mix_buffer.o \
	mix_in_x64_avx2.o mix_in_x64_sse2.o mix_in_x64_avx512bw.o bufferpool.o uring.o arena.o ng_client.o

test-transcode:	test-transcode.o $(COMMONOBJS) codeclib.strhash.o resample.o codec.o ssrc.o call.o ice.o helpers.o \
	kernel.o media_socket.o stun.o bencode.o socket.o poller.o dtls.o recording.o statistics.o \
	rtcp.o redis.o iptables.o graphite.o call_interfaces.strhash.o sdp.strhash.o rtp.o crypto.o \
	control_ng_flags_parser.o control_ng.strhash.o \
	streambuf.o cookie_cache.o udp_listener.o homer.o load.o cdr.o dtmf.o timerthread.o \
	media_player.o jitter_buffer.o dtmflib.o t38.o tcp_listener.o mqtt.o janus.strhash.o websocket.o \
	cli.strhash.o mvr2s_x64_avx2.o mvr2s_x64_avx512.o audio_player.o mix_buffer.o \
	mix_in_x64_avx2.o mix_in_x64_sse2.o mix_in_x64_avx512bw.o bufferpool.o uring.o arena.o ng_client.o

test-resample:	test-resample.o $(COMMONOBJS) codeclib.strhash.o resample.o dtmflib.o mvr2s_x64_avx2.o \
	mvr2s_x64_avx512.o bencode.o

test-payload-tracker: test-payload-tracker.o $(COMMONOBJS) ssrc.o helpers.o auxlib.o rtp.o crypto.o codeclib.strhash.o \
	resample.o dtmflib.o mvr2s_x64_avx2.o mvr2s_x64_avx512.o bufferpool.o uring.o poller.o bencode.o

test-kernel-module: test-kernel-module.o $(COMMONOBJS) kernel.o

test-const_str_hash.strhash: test-const_str_hash.strhash.o $(COMMONOBJS) bencode.o

s3-auth:	s3-auth.o s3utils.o

PRELOAD_CFLAGS += -D_GNU_SOURCE -std=c11
PRELOAD_LIBS += -ldl

tests-preload.so:	tests-preload.c
	$(CC) $(PRELOAD_CFLAGS) -o $@ -shared -fPIC $< $(PRELOAD_LIBS)

time-fudge-preload.so:	time-fudge-preload.c
	$(CC) $(PRELOAD_CFLAGS) -o $@ -shared -fPIC $< $(PRELOAD_LIBS)

spandsp_send_fax_pcm.c:	../lib/spandsp_logging.h
spandsp_send_fax_t38.c:	../lib/spandsp_logging.h
spandsp_recv_fax_t38.c:	../lib/spandsp_logging.h
spandsp_recv_fax_pcm.c:	../lib/spandsp_logging.h