Source

yate / modules / 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
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
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
# Makefile
# This file holds the make rules for the Telephony Engine modules

# override DESTDIR at install time to prefix the install directory
DESTDIR :=

# override DEBUG at compile time to enable full debug or remove it all
DEBUG :=

CC  := @CC@ -Wall
CXX := @CXX@ -Wall
MOC := @QT4_MOC@
QT4_INC := @QT4_INC@
QT4_LIB := @QT4_LIB@
QT4_INC_NET := @QT4_INC_NET@
QT4_LIB_NET := @QT4_LIB_NET@
QT4_STATIC_MODULES :=
HAVE_PGSQL := @HAVE_PGSQL@
PGSQL_INC := @PGSQL_INC@
PGSQL_LIB := -lpq
HAVE_MYSQL := @HAVE_MYSQL@
MYSQL_INC := @MYSQL_INC@
MYSQL_LIB := @MYSQL_LIB@
HAVE_SPANDSP := @HAVE_SPANDSP@
SPANDSP_INC := @SPANDSP_INC@
SPANDSP_LIB := @SPANDSP_LIB@
HAVE_OPENSSL := @HAVE_OPENSSL@
OPENSSL_INC := @OPENSSL_INC@
OPENSSL_LIB := @OPENSSL_LIB@
HAVE_ZLIB := @HAVE_ZLIB@
ZLIB_INC := @ZLIB_INC@
ZLIB_LIB := @ZLIB_LIB@
SED := sed
DEFS :=
INCLUDES := -I.. -I@top_srcdir@
CFLAGS := @CFLAGS@ @MODULE_CFLAGS@ @INLINE_FLAGS@
CPPFLAGS := @CFLAGS@ @MODULE_CPPFLAGS@ @INLINE_FLAGS@
LDFLAGS:= @LDFLAGS@
YATELIBS:= -L.. -lyate @LIBS@
MODFLAGS:= @MODULE_LDFLAGS@
MODRELAX:= @MODULE_LDRELAX@
MODSTRIP:= @MODULE_SYMBOLS@
INCFILES := @top_srcdir@/yateclass.h @top_srcdir@/yatengine.h @top_srcdir@/yatephone.h ../yateversn.h

JUSTSIG := server/ysigchan.yate server/analog.yate \
	server/ciscosm.yate server/sigtransport.yate \
	server/isupmangler.yate

SUBDIRS :=
MKDEPS  := ../config.status
PROGS := cdrbuild.yate cdrfile.yate regexroute.yate \
	tonegen.yate tonedetect.yate wavefile.yate \
	extmodule.yate conference.yate moh.yate pbx.yate \
	dumbchan.yate callfork.yate mux.yate \
	yrtpchan.yate ystunchan.yate \
	ysipchan.yate \
	yiaxchan.yate \
	yjinglechan.yate jabber/jabberserver.yate jabber/jbfeatures.yate \
	ysockschan.yate filetransfer.yate \
	server/pbxassist.yate server/dbpbx.yate server/lateroute.yate \
	server/park.yate server/queues.yate server/queuesnotify.yate \
	server/regfile.yate server/accfile.yate server/register.yate \
	server/callcounters.yate server/cpuload.yate server/ccongestion.yate \
	server/dbwave.yate \
	server/yradius.yate \
	server/ysnmpagent.yate \
	server/monitoring.yate \
	server/sipfeatures.yate \
	server/heartbeat.yate server/clustering.yate \
	server/mgcpgw.yate server/mgcpca.yate \
	server/mrcpspeech.yate \
	server/presence.yate server/subscription.yate \
	server/users.yate \
	$(JUSTSIG) \
	server/analogdetect.yate \
	client/jabberclient.yate \
	callgen.yate analyzer.yate rmanager.yate msgsniff.yate

LIBS :=
DIRS := client server jabber qt4

ifneq ($(HAVE_PGSQL),no)
PROGS := $(PROGS) server/pgsqldb.yate
endif

ifneq ($(HAVE_MYSQL),no)
PROGS := $(PROGS) server/mysqldb.yate
endif

ifneq (@HAVE_RESOLV@,no)
PROGS := $(PROGS) enumroute.yate
endif

ifneq (@HAVE_SOUNDCARD@,no)
PROGS := $(PROGS) client/osschan.yate
endif

ifneq (@HAVE_ALSA@,no)
PROGS := $(PROGS) client/alsachan.yate
endif

ifneq (@HAVE_COREAUDIO@,no)
PROGS := $(PROGS) client/coreaudio.yate
endif

ifneq (@HAVE_QT4@,no)
ifeq (@QT4_STATIC_MODULES@,no)
PROGS := $(PROGS) qt4/updater.yate qt4/customtable.yate qt4/customtext.yate \
	qt4/customtree.yate qt4/widgetlist.yate qt4/clientarchive.yate
endif
endif

ifneq (@HAVE_ZAP@,no)
PROGS := $(PROGS) server/zapcard.yate
endif

ifneq (@HAVE_WANPIPE@,no)
ifeq (@BUILD_WPCARD@,yes)
PROGS := $(PROGS) server/wpcard.yate
endif
ifeq (@HAVE_WANPIPE_API@,yes)
ifeq (@BUILD_TDMCARD@,yes)
PROGS := $(PROGS) server/tdmcard.yate
endif
endif
endif

ifneq (@HAVE_SCTP_NETINET@,no)
PROGS := $(PROGS) server/lksctp.yate
endif

ifneq ($(HAVE_SPANDSP),no)
PROGS := $(PROGS) faxchan.yate
endif

ifneq (@HAVE_H323@,no)
PROGS := $(PROGS) h323chan.yate
endif

ifneq (@HAVE_GSM@,no)
PROGS := $(PROGS) gsmcodec.yate
endif

ifneq (@HAVE_ILBC@,no)
PROGS := $(PROGS) ilbccodec.yate
endif

ifneq (@HAVE_SPEEX@,no)
PROGS := $(PROGS) speexcodec.yate
endif

ifneq (@HAVE_AMRNB@,no)
PROGS := $(PROGS) amrnbcodec.yate
endif

ifneq ($(HAVE_OPENSSL),no)
PROGS := $(PROGS) openssl.yate
endif

ifneq ($(HAVE_ZLIB),no)
PROGS := $(PROGS) zlibcompress.yate
endif

ifeq (@HAVE_COREDUMPER@,yes)
COREDUMP_INC := -DHAVE_COREDUMPER @COREDUMPER_INC@
COREDUMP_LIB := @COREDUMPER_LIB@
endif

LOCALFLAGS =
LOCALLIBS =
CCOMPILE = $(CC) $(DEFS) $(DEBUG) $(INCLUDES) $(CFLAGS)
COMPILE = $(CXX) $(DEFS) $(DEBUG) $(INCLUDES) $(CPPFLAGS)
LINK = $(CXX) $(LDFLAGS)
MODLINK = $(CXX) $(MODFLAGS) $(MODSTRIP) $(LDFLAGS)
MODCOMP = $(COMPILE) $(MODFLAGS) $(MODSTRIP) $(LDFLAGS)

prefix = @prefix@
exec_prefix = @exec_prefix@
moddir = @libdir@/yate

# include optional local make rules
-include YateLocal.mak

.PHONY: all debug ddebug xdebug
all: subdirs do-all $(LIBS) $(PROGS)

debug:
	$(MAKE) all DEBUG=-g3 MODSTRIP=

ddebug:
	$(MAKE) all DEBUG='-g3 -DDEBUG' MODSTRIP=

xdebug:
	$(MAKE) all DEBUG='-g3 -DXDEBUG' MODSTRIP=

.PHONY: strip
strip: all do-strip
	strip --strip-debug --discard-locals $(PROGS)

.PHONY: clean
clean: do-clean
	@-$(RM) $(PROGS) $(LIBS) *.o qt4/*.o qt4/*.moc core 2>/dev/null
	@-for i in $(PROGS) ; do \
	    $(RM) -rf $$i.dSYM 2>/dev/null; \
	done;

.PHONY: install
install: all do-install
	@mkdir -p "$(DESTDIR)$(moddir)/" && \
	for i in $(DIRS) ; do \
	    mkdir -p "$(DESTDIR)$(moddir)/$$i" ; \
	done; \
	for i in $(PROGS) ; do \
	    @INSTALL_D@ "$$i" "$(DESTDIR)$(moddir)/$$i" ; \
	done;

.PHONY: uninstall
uninstall: do-uninstall
	@-for i in $(PROGS) ; do \
	    rm "$(DESTDIR)$(moddir)/$$i" ; \
	done; \
	for i in $(DIRS) $(SUBDIRS) ; do \
	    rmdir "$(DESTDIR)$(moddir)/$$i" ; \
	done;
	@-rmdir "$(DESTDIR)$(moddir)"

.PHONY: subdirs
subdirs:
	@mkdir -p $(DIRS)

qt4/%.o: @srcdir@/qt4/%.cpp $(MKDEPS) $(INCFILES)
	$(MAKE) $(patsubst %.o,%.moc,$@)
	$(COMPILE) -c -o $@ $(QT4_INC) -I@top_srcdir@/clients/qt4 -I@srcdir@/qt4 $<

%.o: @srcdir@/%.cpp $(MKDEPS) $(INCFILES)
	$(COMPILE) -c $<

do-all do-strip do-clean do-install do-uninstall:
	$(if $(SUBDIRS),\
	@target=`echo $@ | $(SED) -e 's/^do-//'`; \
	for i in $(SUBDIRS) ; do \
	    if test -f ./$$i/Makefile ; then \
		$(MAKE) -C ./$$i $${target} || exit 1;\
	    fi; \
	done \
	)

Makefile: @srcdir@/Makefile.in $(MKDEPS)
	cd .. && ./config.status

lib%.so: %.o
	$(LINK) -shared -o $@ $^ $(YATELIBS)

server/%.yate: @srcdir@/server/%.cpp $(MKDEPS) $(INCFILES)
	$(MODCOMP) -o $@ $(LOCALFLAGS) $< $(LOCALLIBS) $(YATELIBS)

client/%.yate: @srcdir@/client/%.cpp $(MKDEPS) $(INCFILES)
	$(MODCOMP) -o $@ $(LOCALFLAGS) $< $(LOCALLIBS) $(YATELIBS)

qt4/%.yate: @srcdir@/qt4/%.cpp ../libyateqt4.so $(MKDEPS) $(INCFILES)
	$(MAKE) $(patsubst %.yate,%.moc,$@)
	$(MODCOMP) -o $@ $(LOCALFLAGS) $(QT4_INC) -I@top_srcdir@/clients/qt4 $< $(LOCALLIBS) ../libyateqt4.so $(QT4_LIB) $(YATELIBS)

qt4/%.moc: @srcdir@/qt4/%.h $(MKDEPS) $(INCFILES)
	mkdir -p qt4 && $(MOC) $(DEFS) $(INCLUDES) $(QT4_INC) -I@top_srcdir@/clients/qt4 -I@srcdir@/qt4 -o $@ $<

%.yate: @srcdir@/%.cpp $(MKDEPS) $(INCFILES)
	$(MODCOMP) -o $@ $(LOCALFLAGS) $< $(LOCALLIBS) $(YATELIBS)

# Take special care of the modules that depend on optional libs

$(JUSTSIG) server/wpcard.yate server/tdmcard.yate server/zapcard.yate: ../libyatesig.so
$(JUSTSIG): LOCALFLAGS = -I@top_srcdir@/libs/ysig
server/wpcard.yate server/tdmcard.yate: LOCALFLAGS = -I@top_srcdir@/libs/ysig @WANPIPE_FLAGS@
server/zapcard.yate: LOCALFLAGS = -I@top_srcdir@/libs/ysig @ZAP_FLAGS@
$(JUSTSIG) server/wpcard.yate server/tdmcard.yate server/zapcard.yate: LOCALLIBS = -lyatesig

server/analogdetect.yate: ../libs/ymodem/libyatemodem.a
server/analogdetect.yate: LOCALFLAGS = -I@top_srcdir@/libs/ymodem
server/analogdetect.yate: LOCALLIBS = -L../libs/ymodem -lyatemodem

h323chan.yate: LOCALFLAGS = -DPHAS_TEMPLATES -D_REENTRANT -DP_HAS_SEMAPHORES @H323_INC@
h323chan.yate: LOCALLIBS = @H323_LIB@

server/pgsqldb.yate: LOCALFLAGS = $(PGSQL_INC)
server/pgsqldb.yate: LOCALLIBS = $(PGSQL_LIB)

server/mysqldb.yate: LOCALFLAGS = $(MYSQL_INC)
server/mysqldb.yate: LOCALLIBS = $(MYSQL_LIB)

enumroute.yate: LOCALLIBS = @RESOLV_LIB@

client/alsachan.yate: LOCALLIBS = -lasound

client/coreaudio.yate: LOCALLIBS = -framework CoreServices  -framework CoreAudio -framework AudioUnit -framework AudioToolBox

yiaxchan.yate: ../libs/yiax/libyateiax.a
yiaxchan.yate: LOCALFLAGS = -I@top_srcdir@/libs/yiax
yiaxchan.yate: LOCALLIBS = -L../libs/yiax -lyateiax

yjinglechan.yate jabber/jabberserver.yate jabber/jbfeatures.yate client/jabberclient.yate: ../libyatejabber.so
yjinglechan.yate jabber/jabberserver.yate jabber/jbfeatures.yate client/jabberclient.yate: LOCALFLAGS = -I@top_srcdir@/libs/yxml -I@top_srcdir@/libs/yjabber
yjinglechan.yate jabber/jabberserver.yate jabber/jbfeatures.yate client/jabberclient.yate: LOCALLIBS = -lyatejabber

server/dbpbx.yate server/pbxassist.yate: ../libs/ypbx/libyatepbx.a
server/dbpbx.yate server/pbxassist.yate: LOCALFLAGS = -I@top_srcdir@/libs/ypbx
server/dbpbx.yate server/pbxassist.yate: LOCALLIBS = -L../libs/ypbx -lyatepbx

server/mgcpca.yate: ../libyatemgcp.so ../libyatesig.so ../libs/ysdp/libyatesdp.a
server/mgcpca.yate: LOCALFLAGS = -I@top_srcdir@/libs/ymgcp -I@top_srcdir@/libs/ysig -I@top_srcdir@/libs/ysdp
server/mgcpca.yate: LOCALLIBS = -lyatemgcp -lyatesig -L../libs/ysdp -lyatesdp

server/mgcpgw.yate: ../libyatemgcp.so
server/mgcpgw.yate: LOCALFLAGS = -I@top_srcdir@/libs/ymgcp
server/mgcpgw.yate: LOCALLIBS = -lyatemgcp

server/lksctp.yate: LOCALFLAGS = @SCTP_FLAGS@
server/lksctp.yate: LOCALLIBS = -lsctp

ilbccodec.yate: ../libs/ilbc/libilbc.a
ilbccodec.yate: LOCALFLAGS = @ILBC_INC@
ilbccodec.yate: LOCALLIBS = -L../libs/ilbc -lilbc

gsmcodec.yate: LOCALFLAGS = @GSM_INC@
gsmcodec.yate: LOCALLIBS = @GSM_LIB@

speexcodec.yate: LOCALFLAGS = @SPEEX_INC@
speexcodec.yate: LOCALLIBS = @SPEEX_LIB@

amrnbcodec.yate: LOCALFLAGS = @AMRNB_INC@
amrnbcodec.yate: LOCALLIBS = @AMRNB_LIB@

faxchan.yate: LOCALFLAGS = $(SPANDSP_INC)
faxchan.yate: LOCALLIBS = $(SPANDSP_LIB)

ysipchan.yate: ../libs/ysip/libyatesip.a ../libs/ysdp/libyatesdp.a
ysipchan.yate: LOCALFLAGS = -I@top_srcdir@/libs/ysip -I@top_srcdir@/libs/ysdp
ysipchan.yate: LOCALLIBS = -L../libs/ysip -lyatesip -L../libs/ysdp -lyatesdp

yrtpchan.yate: ../libs/yrtp/libyatertp.a
yrtpchan.yate: LOCALFLAGS = -I@top_srcdir@/libs/yrtp
yrtpchan.yate: LOCALLIBS = -L../libs/yrtp -lyatertp

openssl.yate: LOCALFLAGS = $(OPENSSL_INC)
openssl.yate: LOCALLIBS = $(OPENSSL_LIB)

rmanager.yate: LOCALFLAGS = $(COREDUMP_INC)
rmanager.yate: LOCALLIBS = $(COREDUMP_LIB)

qt4/updater.yate: LOCALFLAGS = $(QT4_INC_NET)
qt4/updater.yate: LOCALLIBS = $(QT4_LIB_NET)

server/sipfeatures.yate: ../libs/yxml/libyatexml.a
server/sipfeatures.yate: LOCALFLAGS = -I@top_srcdir@/libs/yxml
server/sipfeatures.yate: LOCALLIBS = -L../libs/yxml -lyatexml

zlibcompress.yate: LOCALFLAGS = $(ZLIB_INC)
zlibcompress.yate: LOCALLIBS = $(ZLIB_LIB)

server/ysnmpagent.yate: ../libs/yasn/libyasn.a ../libs/ysnmp/libysnmp.a
server/ysnmpagent.yate: LOCALFLAGS = -I@top_srcdir@/libs/yasn -I@top_srcdir@/libs/ysnmp
server/ysnmpagent.yate: LOCALLIBS = -L../libs/yasn -lyasn -L../libs/ysnmp -lysnmp

../libyatesig.so ../libs/ysig/libyatesig.a:
	$(MAKE) -C ../libs/ysig

../libs/ilbc/libilbc.a:
	$(MAKE) -C ../libs/ilbc

../libs/ysip/libyatesip.a:
	$(MAKE) -C ../libs/ysip

../libs/yrtp/libyatertp.a:
	$(MAKE) -C ../libs/yrtp

../libs/ysdp/libyatesdp.a:
	$(MAKE) -C ../libs/ysdp

../libs/yiax/libyateiax.a:
	$(MAKE) -C ../libs/yiax

../libyatemgcp.so ../libs/ymgcp/libyatemgcp.a:
	$(MAKE) -C ../libs/ymgcp

../libs/ymodem/libyatemodem.a:
	$(MAKE) -C ../libs/ymodem

../libs/yxml/libyatexml.a:
	$(MAKE) -C ../libs/yxml

../libyatejabber.so ../libs/yjabber/libyatejabber.a:
	$(MAKE) -C ../libs/yjabber

../libs/ypbx/libyatepbx.a:
	$(MAKE) -C ../libs/ypbx

../libyateqt4.so:
	$(MAKE) -C ../clients/qt4

../libs/yasn/libyasn.a:
	$(MAKE) -C ../libs/yasn

../libs/ysnmp/libysnmp.a:
	$(MAKE) -C ../libs/ysnmp