forked from voipmonitor/sniffer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
225 lines (189 loc) · 9.88 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
##### CPU variants #####
GCCARCH = $(shell uname -m)
MTUNE =
ifeq ($(GCCARCH),amd64)
GCCARCH = core2
MTUNE = -mtune=core2
endif
ifeq ($(GCCARCH),i386)
GCCARCH = core2
MTUNE = -mtune=core2
endif
ifeq ($(GCCARCH),x86_64)
GCCARCH = core2
MTUNE = -mtune=core2
endif
ifeq ($(findstring arm,$(GCCARCH)),arm)
GCCARCH = armv6k
endif
#GCCVERSION = $(shell gcc --version | grep ^gcc | sed 's/^.* //g' | cut -f1,2 -d.)
#ifeq "$(GCCVERSION)" "4.1"
# GCCARCH = core2
#endif
.DEFAULT_GOAL := shared
.PHONY: default
default: shared ;
core2cust: GCCARCH = core2
core2: GCCARCH = core2
armv6k: GCCARCH = armv6k
clean: GCCARCH = core2
ss7: core2 static
ss7: CXXFLAGS += -DHAVE_LIBWIRESHARK -I/usr/src/wireshark -I/usr/src
ss7: SS7= -L/usr/src/wireshark/epan/.libs/ -L/usr/src/wireshark/wsutil/.libs/ -L/usr/src/wireshark/epan/wslua/.libs/ -L/usr/src/wireshark/wiretap/.libs/ -lwiretap -lwireshark -lwsutil -llua5.1 -lwslua -lgmodule-2.0 -lglib-2.0 -lpcre -llz4
#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 | 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 =-lgcrypt -lgpg-error $(shell pkg-config --cflags @LIBJSON_NAME@)
MYSQLLIB=@MYSQLLIB@
MYSQLINC=@MYSQLINCLUDE@
GLIBCFLAGS =$(shell pkg-config --cflags glib-2.0)
GLIBLIB =$(shell pkg-config --libs glib-2.0)
LIBPNG=@LIBPNG@
LIBFFT=@LIBFFT@
LIBLD=@LIBLD@
LIBLZMA=@LIBLZMA@
LIBSSH=@LIBSSH@
LIBGNUTLS=@LIBGNUTLS@
LIBGNUTLSSTATIC=-lgcrypt -lgpg-error $(shell pkg-config gnutls --libs --static)
SHARED_LIBS = ${LIBLD} -lpthread -lpcap -lz -lvorbis -lvorbisenc -logg -lodbc ${MYSQLLIB} -lrt -lsnappy -lcurl -lssl -lcrypto ${JSONLIB} ${LIBSSH} -lxml2 -lrrd ${LIBGNUTLS} @LIBTCMALLOC@ ${GLIBLIB} ${LIBLZMA} -llzo2 ${LIBPNG} ${LIBFFT}
STATIC_LIBS = -static @LIBTCMALLOC@ -lodbc -lltdl ${LIBLD} -lrt -lz ${LIBSSH} -lcrypt -lm -lcurl -lssl -lcrypto -static-libstdc++ -static-libgcc -lpcap -lpthread ${MYSQLLIB} -lpthread -lz -lc -lvorbis -lvorbisenc -logg -lrt -lsnappy ${JSONLIB} -lrrd -lxml2 ${GLIBLIB} -lpcre -lz -ldbi -llzma ${LIBGNUTLSSTATIC} -llzo2 ${LIBPNG} ${LIBFFT} -lpthread ${SS7}
INCLUDES = -I/usr/local/include ${MYSQLINC} -I jitterbuffer/ ${JSONCFLAGS} ${GLIBCFLAGS}
LIBS_PATH = -L/usr/local/lib/
CXXFLAGS += -Wall -fPIC -g3 -O2 -march=$(GCCARCH) ${MTUNE} ${INCLUDES}
CFLAGS += ${CXXFLAGS}
LIBS = ${SHARED_LIBS}
LIBS2 = @LIBS2@
shared: LDFLAGS += -Wl,--allow-multiple-definition
shared: cleantest $(objects)
${CXX} $(objects) ${LDFLAGS} -o voipmonitor ${LIBS_PATH} ${LIBS}
static: LDFLAGS += -Wl,--allow-multiple-definition
static: cleantest $(objects)
${CXX} $(objects) ${LDFLAGS} -o voipmonitor ${LIBS_PATH} ${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} $(LDFLAGS) -o voipmonitor $(STARTFILES) ${objects} $(LIBGROUP) $(ENDFILES) -L/opt/libc/lib ${STATIC_LIBS} ${LIBS_PATH}
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
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
install:
install voipmonitor /usr/local/sbin/