-
Notifications
You must be signed in to change notification settings - Fork 108
/
Makefile.in
266 lines (231 loc) · 13.2 KB
/
Makefile.in
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
##### CPU variants #####
GCCARCH = native
MTUNE = -mtune=native
FBSDDEF =
PLATFORM = $(shell uname)
ifeq ($(PLATFORM),FreeBSD)
FBSDDEF = -D __vm_FREEBSD__
endif
.DEFAULT_GOAL := shared
.PHONY: default
default: shared ;
WIRESHARKLIBSTATIC =$(shell pkg-config --libs-only-l --static wireshark)
WIRESHARKLIBSHARED =$(shell pkg-config --libs-only-l wireshark)
WIRESHARKCFLAGS =$(shell pkg-config --cflags wireshark)
core2cust: GCCARCH = core2
core2: GCCARCH = core2
armv6k: GCCARCH = armv6k
clean: GCCARCH = core2
ss7: core2 static
ss7: CXXFLAGS += -DHAVE_LIBWIRESHARK -DLIBWIRESHARK_VERSION=30605 ${WIRESHARKCFLAGS}
ss7: SS7= ${WIRESHARKLIBSTATIC} -lwiretap -lwsutil -llua5.2 -lxml2 -llz4 -llzma -lz -lcares -lnghttp2
ss7shared: shared
ss7shared: SS7= ${WIRESHARKLIBSHARED} -lwiretap -lwsutil -llua5.2 -lxml2 -llz4 -llzma -lz -lcares -lnghttp2 -lgnutls
ss7shared: CXXFLAGS += -DHAVE_LIBWIRESHARK -DLIBWIRESHARK_VERSION=30605 ${WIRESHARKCFLAGS}
#Makefile.deps: GCCARCH = core2
version = $(shell grep RTPSENSOR_VERSION voipmonitor_define.h | cut -d" " -f 3 | tr -d "\"")
objects = $(shell ls -1 *.cpp | sed 's/\.cpp/.o/' | tr "\n" " ") $(shell ls -1 jitterbuffer/*.c | sed 's/\.c/.o/' | tr "\n" " ") $(shell ls -1 dssl/*.c dssl/*.cpp | sed 's/\.cpp/.o/' | sed 's/\.c/.o/' | tr "\n" " ") cloud_router/cloud_router_base.o cloud_router/cloud_router_client.o
#headers = $(shell ls -1 *.h | tr "\n" " ") $(shell ls -1 jitterbuffer/*.h | tr "\n" " ") $(shell ls -1 jitterbuffer/asterisk/*.h | tr "\n" " ")
JSONLIB = $(shell pkg-config --libs @LIBJSON_NAME@)
JSONCFLAGS = $(shell pkg-config --cflags @LIBJSON_NAME@)
MYSQLLIB=@MYSQLLIB@
MYSQLINC=@MYSQLINCLUDE@
MYSQL_WITHOUT_SSL_SUPPORT=@MYSQL_WITHOUT_SSL_SUPPORT@
DPDKINC=@DPDKINCLUDE@
DPDKLIB=@DPDKLIBRARY@
ifeq ($(MYSQL_WITHOUT_SSL_SUPPORT),yes)
MYSQL_WITHOUT_SSL_SUPPORT = -D MYSQL_WITHOUT_SSL_SUPPORT
endif
GLIBCFLAGS =$(shell pkg-config --cflags glib-2.0)
GLIBLIB =$(shell pkg-config --libs glib-2.0)
GLIBLIBSTATIC =$(shell pkg-config --libs --static glib-2.0)
GLIBLIBPATH =$(shell pkg-config --libs-only-L glib-2.0)
CURLCFLAGS =$(shell pkg-config --cflags libcurl)
CURLLIB =$(shell pkg-config --libs libcurl)
CURLLIBSTATIC =$(shell pkg-config --libs --static libcurl)
PCAPLIBSTATIC =$(shell pkg-config --libs --static libpcap)
LIBPNG=@LIBPNG@
LIBJPEG=@LIBJPEG@
LIBFFT=@LIBFFT@
LIBLD=@LIBLD@
LIBLZMA=@LIBLZMA@
LIBZSTD=@LIBZSTD@
LIBLZ4=@LIBLZ4@
LIBGNUTLS=@LIBGNUTLS@
LIBBLAKE3=@LIBBLAKE3@
LIBWHISPER=@LIBWHISPER@
LIBGNUTLSSTATIC=-lgcrypt -lgpg-error $(shell pkg-config gnutls --libs --static)
SHARED_LIBS = ${LIBLD} -licuuc -licudata -lpthread -lpcap -lz -lvorbis -lvorbisenc -logg -lodbc ${MYSQLLIB} -lrt -lsnappy -lcurl -lssl -lcrypto ${JSONLIB} -lxml2 -lrrd ${LIBGNUTLS} @LIBTCMALLOC@ ${GLIBLIB} ${LIBLZMA} ${LIBZSTD} ${LIBLZ4} -llzo2 ${LIBPNG} ${LIBJPEG} ${LIBFFT} @DPDK_LDFLAGS@ ${SS7} @FLTO@ ${LIBBLAKE3} ${LIBWHISPER}
STATIC_LIBS = -static @LIBCDIRLIB@ @LIBTCMALLOC@ -licuuc -licudata -lodbc -lltdl -lrt -lz -lcrypt -lm ${CURLLIBSTATIC} -lssl -lcrypto -static-libstdc++ -static-libgcc ${PCAPLIBSTATIC} -lpthread ${MYSQLLIB} -lpthread -lz -lc -lvorbis -lvorbisenc -logg -lrt -lsnappy ${JSONLIB} -lrrd -lxml2 ${GLIBLIBSTATIC} -lpcre -lz -ldbi ${LIBLZMA} ${LIBZSTD} ${LIBLZ4} ${LIBGNUTLSSTATIC} ${LIBGNUTLSSTATIC} -llzo2 ${LIBPNG} ${LIBJPEG} ${LIBFFT} -lpthread ${SS7} ${LIBLD} @FLTO@ @DPDK_LDFLAGSSTATIC@ ${LIBBLAKE3} ${LIBWHISPER}
INCLUDES = @LIBCDIRINC@ ${DPDKINC} -I/usr/local/include ${MYSQLINC} -I jitterbuffer/ ${JSONCFLAGS} ${GLIBCFLAGS} @OPENSSLDIRINC@
LIBS_PATH = ${DPDKLIB} -L/usr/local/lib/ @OPENSSLDIRLIB@ ${GLIBLIBPATH}
CXXFLAGS += -Wall -fPIC -g3 -O3 @FLTO@ -march=$(GCCARCH) ${MTUNE} ${INCLUDES} ${FBSDDEF} ${MYSQL_WITHOUT_SSL_SUPPORT} @HEAPPROF_CXXFLAG@ @DPDK_CFLAGS@
CFLAGS += ${CXXFLAGS}
LIBS = ${SHARED_LIBS}
LIBS2 = @LIBS2@
CFLAGS += @CFLAGS@
CXXFLAGS += @CXXFLAGS@
LDFLAGS += @LDFLAGS@
shared: LDFLAGS += -Wl,--allow-multiple-definition
shared: cleantest $(objects)
${CXX} $(objects) ${LIBS_PATH} ${LDFLAGS} -o voipmonitor ${LIBS}
static: LDFLAGS += -Wl,--allow-multiple-definition
static: cleantest $(objects)
${CXX} $(objects) ${LIBS_PATH} ${LDFLAGS} -o voipmonitor ${STATIC_LIBS}
core2: cleantest static
armv6k: cleantest static
armv5shared: CXXFLAGS+= -DPACKED
armv5shared: CFLAGS+= -DPACKED
armv5shared: cleantest shared
armv5static: CXXFLAGS+= -DPACKED
armv5static: CFLAGS+= -DPACKED
armv5static: cleantest static
core2cust: LDFLAGS = -nostartfiles -static -Wl,--allow-multiple-definition
core2cust: GLIBCDIR = /opt/libc/lib
core2cust: STARTFILES = $(GLIBCDIR)/crt1.o $(GLIBCDIR)/crti.o $(shell gcc --print-file-name=crtbegin.o)
core2cust: ENDFILES = $(shell gcc --print-file-name=crtend.o) $(GLIBCDIR)/crtn.o
core2cust: LIBGROUP = -Wl,--start-group $(GLIBCDIR)/libc.a -lgcc -lgcc_eh -Wl,--end-group
core2cust: CXXFLAGS += -I /opt/libc/include
core2cust: CFLAGS += ${CXXFLAGS}
core2cust: cleantest $(objects)
${CXX} ${LIBS_PATH} $(LDFLAGS) -o voipmonitor $(STARTFILES) ${objects} $(LIBGROUP) $(ENDFILES) -L/opt/libc/lib ${STATIC_LIBS}
DEPENDSC:=${shell find . -type f -name '*.c' -print}
DEPENDSCPP:=${shell find . -type f -name '*.cpp' -print}
-include Makefile.deps
Makefile.deps:
cp /dev/null Makefile.deps
for F in $(DEPENDSC); do \
D=`dirname $$F | sed "s/^\.\///"`; \
echo -n "$$D/" >> Makefile.deps; \
$(CC) $(CFLAGS) -MM -MG $$F \
>> Makefile.deps; \
done
for F in $(DEPENDSCPP); do \
D=`dirname $$F | sed "s/^\.\///"`; \
echo -n "$$D/" >> Makefile.deps; \
$(CXX) $(CXXFLAGS) -MM -MG $$F \
>> Makefile.deps; \
done
cleantest:
@cmp -s .cleancount .lastclean || $(MAKE) clean
clean :
rm -f Makefile.deps
rm -f $(objects) voipmonitor
cp -f .cleancount .lastclean
targzarmv6k: armv6k
rm -rf voipmonitor-armv6k-${version}-static*
mkdir -p voipmonitor-armv6k-${version}-static/usr/local/sbin
cp voipmonitor voipmonitor-armv6k-${version}-static/usr/local/sbin/
chmod +x voipmonitor-armv6k-${version}-static/usr/local/sbin/voipmonitor
mkdir -p voipmonitor-armv6k-${version}-static/usr/local/share/voipmonitor/audio
cp samples/audio/* voipmonitor-armv6k-${version}-static/usr/local/share/voipmonitor/audio/
mkdir -p voipmonitor-armv6k-${version}-static/etc/init.d
cp config/voipmonitor.conf voipmonitor-armv6k-${version}-static/etc/
cp config/init.d/voipmonitor voipmonitor-armv6k-${version}-static/etc/init.d/
chmod +x voipmonitor-armv6k-${version}-static/etc/init.d/voipmonitor
cp scripts/install-script.sh voipmonitor-armv6k-${version}-static/
chmod +x voipmonitor-armv6k-${version}-static/install-script.sh
tar -czf voipmonitor-armv6k-${version}-static.tar.gz voipmonitor-armv6k-${version}-static
rm -rf voipmonitor-armv6k-${version}-static
targz64: core2
rm -rf voipmonitor-amd64-${version}-static*
mkdir -p voipmonitor-amd64-${version}-static/usr/local/sbin
cp voipmonitor voipmonitor-amd64-${version}-static/usr/local/sbin/
chmod +x voipmonitor-amd64-${version}-static/usr/local/sbin/voipmonitor
mkdir -p voipmonitor-amd64-${version}-static/usr/local/share/voipmonitor/audio
cp samples/audio/* voipmonitor-amd64-${version}-static/usr/local/share/voipmonitor/audio/
mkdir -p voipmonitor-amd64-${version}-static/etc/init.d
cp config/voipmonitor.conf voipmonitor-amd64-${version}-static/etc/
cp config/init.d/voipmonitor voipmonitor-amd64-${version}-static/etc/init.d/
chmod +x voipmonitor-amd64-${version}-static/etc/init.d/voipmonitor
cp scripts/install-script.sh voipmonitor-amd64-${version}-static/
chmod +x voipmonitor-amd64-${version}-static/install-script.sh
tar -czf voipmonitor-amd64-${version}-static.tar.gz voipmonitor-amd64-${version}-static
rm -rf voipmonitor-amd64-${version}-static
targz64ivybridge: core2
rm -rf voipmonitor-amd64-${version}-ivybridge-static*
mkdir -p voipmonitor-amd64-${version}-ivybridge-static/usr/local/sbin
cp voipmonitor voipmonitor-amd64-${version}-ivybridge-static/usr/local/sbin/
chmod +x voipmonitor-amd64-${version}-ivybridge-static/usr/local/sbin/voipmonitor
mkdir -p voipmonitor-amd64-${version}-ivybridge-static/usr/local/share/voipmonitor/audio
cp samples/audio/* voipmonitor-amd64-${version}-ivybridge-static/usr/local/share/voipmonitor/audio/
mkdir -p voipmonitor-amd64-${version}-ivybridge-static/etc/init.d
cp config/voipmonitor.conf voipmonitor-amd64-${version}-ivybridge-static/etc/
cp config/init.d/voipmonitor voipmonitor-amd64-${version}-ivybridge-static/etc/init.d/
chmod +x voipmonitor-amd64-${version}-ivybridge-static/etc/init.d/voipmonitor
cp scripts/install-script.sh voipmonitor-amd64-${version}-ivybridge-static/
chmod +x voipmonitor-amd64-${version}-ivybridge-static/install-script.sh
tar -czf voipmonitor-amd64-${version}-ivybridge-static.tar.gz voipmonitor-amd64-${version}-ivybridge-static
rm -rf voipmonitor-amd64-${version}-ivybridge-static
targz64heapprof: core2
rm -rf voipmonitor-heapprof-amd64-${version}-static*
mkdir -p voipmonitor-heapprof-amd64-${version}-static/usr/local/sbin
cp voipmonitor voipmonitor-heapprof-amd64-${version}-static/usr/local/sbin/
chmod +x voipmonitor-heapprof-amd64-${version}-static/usr/local/sbin/voipmonitor
mkdir -p voipmonitor-heapprof-amd64-${version}-static/usr/local/share/voipmonitor/audio
cp samples/audio/* voipmonitor-heapprof-amd64-${version}-static/usr/local/share/voipmonitor/audio/
mkdir -p voipmonitor-heapprof-amd64-${version}-static/etc/init.d
cp config/voipmonitor.conf voipmonitor-heapprof-amd64-${version}-static/etc/
cp config/init.d/voipmonitor voipmonitor-heapprof-amd64-${version}-static/etc/init.d/
chmod +x voipmonitor-heapprof-amd64-${version}-static/etc/init.d/voipmonitor
cp scripts/install-script.sh voipmonitor-heapprof-amd64-${version}-static/
chmod +x voipmonitor-heapprof-amd64-${version}-static/install-script.sh
tar -czf voipmonitor-heapprof-amd64-${version}-static.tar.gz voipmonitor-heapprof-amd64-${version}-static
rm -rf voipmonitor-heapprof-amd64-${version}-static
targz64debug: core2
rm -rf voipmonitor-amd64-${version}-static*
mkdir -p voipmonitor-amd64-${version}-static/usr/local/sbin
cp voipmonitor voipmonitor-amd64-${version}-static/usr/local/sbin/
chmod +x voipmonitor-amd64-${version}-static/usr/local/sbin/voipmonitor
mkdir -p voipmonitor-amd64-${version}-static/usr/local/share/voipmonitor/audio
cp samples/audio/* voipmonitor-amd64-${version}-static/usr/local/share/voipmonitor/audio/
mkdir -p voipmonitor-amd64-${version}-static/etc/init.d
cp config/voipmonitor.conf voipmonitor-amd64-${version}-static/etc/
cp config/init.d/voipmonitor voipmonitor-amd64-${version}-static/etc/init.d/
chmod +x voipmonitor-amd64-${version}-static/etc/init.d/voipmonitor
cp scripts/install-script.sh voipmonitor-amd64-${version}-static/
chmod +x voipmonitor-amd64-${version}-static/install-script.sh
tar -czf voipmonitor-amd64-${version}-static-debug.tar.gz voipmonitor-amd64-${version}-static
rm -rf voipmonitor-amd64-${version}-static
targz64ss7: ss7
rm -rf voipmonitor-wireshark-amd64-${version}-static*
mkdir -p voipmonitor-wireshark-amd64-${version}-static/usr/local/sbin
cp voipmonitor voipmonitor-wireshark-amd64-${version}-static/usr/local/sbin/
chmod +x voipmonitor-wireshark-amd64-${version}-static/usr/local/sbin/voipmonitor
mkdir -p voipmonitor-wireshark-amd64-${version}-static/usr/local/share/voipmonitor/audio
cp samples/audio/* voipmonitor-wireshark-amd64-${version}-static/usr/local/share/voipmonitor/audio/
mkdir -p voipmonitor-wireshark-amd64-${version}-static/etc/init.d
cp config/voipmonitor.conf voipmonitor-wireshark-amd64-${version}-static/etc/
cp config/init.d/voipmonitor voipmonitor-wireshark-amd64-${version}-static/etc/init.d/
chmod +x voipmonitor-wireshark-amd64-${version}-static/etc/init.d/voipmonitor
cp scripts/install-script.sh voipmonitor-wireshark-amd64-${version}-static/
chmod +x voipmonitor-wireshark-amd64-${version}-static/install-script.sh
tar -czf voipmonitor-wireshark-amd64-${version}-static.tar.gz voipmonitor-wireshark-amd64-${version}-static
rm -rf voipmonitor-wireshark-amd64-${version}-static
targz32: core2cust
rm -rf voipmonitor-i686-${version}-static*
mkdir -p voipmonitor-i686-${version}-static/usr/local/sbin
cp voipmonitor voipmonitor-i686-${version}-static/usr/local/sbin/
chmod +x voipmonitor-i686-${version}-static/usr/local/sbin/voipmonitor
mkdir -p voipmonitor-amd64-${version}-static/usr/local/share/voipmonitor/audio
cp samples/audio/* voipmonitor-amd64-${version}-static/usr/local/share/voipmonitor/audio/
mkdir -p voipmonitor-i686-${version}-static/etc/init.d
cp config/voipmonitor.conf voipmonitor-i686-${version}-static/etc/
cp config/init.d/voipmonitor voipmonitor-i686-${version}-static/etc/init.d/
chmod +x voipmonitor-i686-${version}-static/etc/init.d/voipmonitor
cp scripts/install-script.sh voipmonitor-i686-${version}-static/
chmod +x voipmonitor-i686-${version}-static/install-script.sh
tar -czf voipmonitor-i686-${version}-static.tar.gz voipmonitor-i686-${version}-static
rm -rf voipmonitor-i686-${version}-static
source: clean
rm -rf voipmonitor-${version}-src
mkdir voipmonitor-${version}-src
cp -a * voipmonitor-${version}-src/
rm -rf voipmonitor-${version}-src/voipmonitor-${version}-src
rm -rf `find voipmonitor-${version}-src -type d -name .svn`
rm voipmonitor-${version}-src/Makefile
echo 1 > voipmonitor-${version}-src/.cleancount
tar -czf voipmonitor-${version}-src.tar.gz voipmonitor-${version}-src
BIN_PATH = $(if @exec_prefix@, @exec_prefix@, /usr/local/sbin)
install:
install voipmonitor $(BIN_PATH)/