272 lines
6.8 KiB
Makefile
272 lines
6.8 KiB
Makefile
# 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
|
|
SED := sed
|
|
DEFS :=
|
|
INCLUDES := -I.. -I@top_srcdir@
|
|
CFLAGS := -O2 @MODULE_CFLAGS@ @INLINE_FLAGS@
|
|
CPPFLAGS := -O2 @MODULE_CPPFLAGS@ @INLINE_FLAGS@
|
|
LDFLAGS:= -L.. -lyate
|
|
MODFLAGS:= @MODULE_LDFLAGS@
|
|
MODRELAX:= @MODULE_LDRELAX@
|
|
MODSTRIP:= @MODULE_SYMBOLS@
|
|
INCFILES := @top_srcdir@/yateclass.h @top_srcdir@/yatengine.h @top_srcdir@/yatephone.h ../yateversn.h
|
|
|
|
SUBDIRS := skin help gtk2
|
|
MKDEPS := ../config.status
|
|
PROGS := cdrbuild.yate cdrfile.yate \
|
|
regexroute.yate regfile.yate accfile.yate register.yate \
|
|
tonegen.yate tonedetect.yate wavefile.yate \
|
|
conference.yate moh.yate \
|
|
callgen.yate analyzer.yate rmanager.yate msgsniff.yate \
|
|
pbx.yate dbpbx.yate pbxassist.yate park.yate \
|
|
dumbchan.yate callfork.yate queues.yate \
|
|
extmodule.yate yradius.yate \
|
|
yrtpchan.yate ystunchan.yate \
|
|
ysipchan.yate sipfeatures.yate \
|
|
yiaxchan.yate \
|
|
yjinglechan.yate
|
|
LIBS :=
|
|
|
|
ifneq (@HAVE_PGSQL@,no)
|
|
PROGS := $(PROGS) pgsqldb.yate
|
|
endif
|
|
|
|
ifneq (@HAVE_MYSQL@,no)
|
|
PROGS := $(PROGS) mysqldb.yate
|
|
endif
|
|
|
|
ifneq (@HAVE_RESOLV@,no)
|
|
PROGS := $(PROGS) enumroute.yate
|
|
endif
|
|
|
|
ifneq (@HAVE_SOUNDCARD@,no)
|
|
PROGS := $(PROGS) osschan.yate
|
|
endif
|
|
|
|
ifneq (@HAVE_ALSA@,no)
|
|
PROGS := $(PROGS) alsachan.yate
|
|
endif
|
|
|
|
ifeq (@HAVE_PRI@_@HAVE_ZAP@,yes_yes)
|
|
PROGS := $(PROGS) zapchan.yate
|
|
endif
|
|
|
|
ifeq (@HAVE_PRI_CB@_@HAVE_WANPIPE@,yes_yes)
|
|
PROGS := $(PROGS) wpchan.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
|
|
|
|
ifeq (@HAVE_GTK2@_@HAVE_GMOZ@,yes_yes)
|
|
PROGS := $(PROGS) gtk2/gtk2mozilla.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)
|
|
|
|
basedir = @libdir@/yate
|
|
prefix = @prefix@
|
|
exec_prefix = @exec_prefix@
|
|
moddir = $(basedir)/modules
|
|
|
|
# include optional local make rules
|
|
-include YateLocal.mak
|
|
|
|
.PHONY: all debug ddebug xdebug
|
|
all: 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 core 2>/dev/null
|
|
|
|
.PHONY: install
|
|
install: all do-install
|
|
@mkdir -p "$(DESTDIR)$(moddir)/" && \
|
|
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; \
|
|
$(if $(SUBDIRS),\
|
|
for i in $(SUBDIRS) ; do \
|
|
rmdir "$(DESTDIR)$(moddir)/$$i" ; \
|
|
done; \
|
|
)
|
|
@-rmdir "$(DESTDIR)$(moddir)"
|
|
@-rmdir "$(DESTDIR)$(basedir)"
|
|
|
|
%.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 $@ $^
|
|
|
|
%.yate: @srcdir@/%.cpp $(MKDEPS) $(INCFILES)
|
|
$(MODCOMP) -o $@ $(LOCALFLAGS) $< $(LOCALLIBS)
|
|
|
|
|
|
# Take special care of the modules that depend on optional libs
|
|
|
|
zapchan.yate: libypri.o
|
|
zapchan.yate: LOCALFLAGS = @ZAP_FLAGS@
|
|
zapchan.yate: LOCALLIBS = libypri.o -lpri
|
|
|
|
wpchan.yate: libypri.o
|
|
wpchan.yate: LOCALFLAGS = @WANPIPE_HWEC_INC@
|
|
wpchan.yate: LOCALLIBS = libypri.o -lpri
|
|
|
|
ysigchan.yate wpcard.yate zapcard.yate: ../libyatess7.so
|
|
ysigchan.yate wpcard.yate zapcard.yate: LOCALFLAGS = -I../contrib/yss7
|
|
ysigchan.yate wpcard.yate zapcard.yate: LOCALLIBS = -lyatess7
|
|
|
|
h323chan.yate: LOCALFLAGS = -DPHAS_TEMPLATES -D_REENTRANT -DP_HAS_SEMAPHORES @H323_INC@
|
|
h323chan.yate: LOCALLIBS = @H323_LIB@
|
|
|
|
pgsqldb.yate: LOCALFLAGS = @PGSQL_INC@
|
|
pgsqldb.yate: LOCALLIBS = -lpq
|
|
|
|
mysqldb.yate: LOCALFLAGS = @MYSQL_INC@
|
|
mysqldb.yate: LOCALLIBS = @MYSQL_LIB@
|
|
|
|
enumroute.yate: LOCALLIBS = -lresolv
|
|
|
|
alsachan.yate: LOCALLIBS = -lasound
|
|
|
|
yiaxchan.yate: ../contrib/yiax/libyateiax.a
|
|
yiaxchan.yate: LOCALFLAGS = -I@top_srcdir@/contrib/yiax
|
|
yiaxchan.yate: LOCALLIBS = -L../contrib/yiax -lyateiax
|
|
|
|
yjinglechan.yate: ../contrib/yxml/libyatexml.a ../contrib/yjingle/libyatejingle.a
|
|
yjinglechan.yate: LOCALFLAGS = -I@top_srcdir@/contrib/yxml -I@top_srcdir@/contrib/yjingle
|
|
yjinglechan.yate: LOCALLIBS = -L../contrib/yjingle -L../contrib/yxml -lyatejingle -lyatexml
|
|
|
|
dbpbx.yate: ../contrib/ypbx/libyatepbx.a
|
|
dbpbx.yate: LOCALFLAGS = -I@top_srcdir@/contrib/ypbx
|
|
dbpbx.yate: LOCALLIBS = ../contrib/ypbx/libyatepbx.a
|
|
|
|
pbxassist.yate: ../contrib/ypbx/libyatepbx.a
|
|
pbxassist.yate: LOCALFLAGS = -I@top_srcdir@/contrib/ypbx
|
|
pbxassist.yate: LOCALLIBS = ../contrib/ypbx/libyatepbx.a
|
|
|
|
ilbccodec.yate: ../contrib/ilbc/libilbc.a
|
|
ilbccodec.yate: LOCALLIBS = ../contrib/ilbc/libilbc.a
|
|
ilbccodec.yate: LOCALFLAGS = @ILBC_INC@
|
|
|
|
gsmcodec.yate: LOCALLIBS = -lgsm
|
|
gsmcodec.yate: LOCALFLAGS = @GSM_INC@
|
|
|
|
speexcodec.yate: LOCALLIBS = -lspeex
|
|
speexcodec.yate: LOCALFLAGS = @SPEEX_INC@
|
|
|
|
faxchan.yate: LOCALLIBS = -lspandsp
|
|
faxchan.yate: LOCALFLAGS = @SPANDSP_INC@
|
|
|
|
ysipchan.yate: ../contrib/ysip/libyatesip.a
|
|
ysipchan.yate: LOCALFLAGS = -I@top_srcdir@/contrib/ysip
|
|
ysipchan.yate: LOCALLIBS = ../contrib/ysip/libyatesip.a
|
|
|
|
yrtpchan.yate: ../contrib/yrtp/libyatertp.a
|
|
yrtpchan.yate: LOCALFLAGS = -I@top_srcdir@/contrib/yrtp
|
|
yrtpchan.yate: LOCALLIBS = ../contrib/yrtp/libyatertp.a
|
|
|
|
gtk2/gtk2mozilla.yate: @top_srcdir@/contrib/gtk2/gtk2client.h
|
|
gtk2/gtk2mozilla.yate: LOCALFLAGS = @GTK2_INC@ @GMOZ_INC@ -I@top_srcdir@/contrib/gtk2
|
|
gtk2/gtk2mozilla.yate: LOCALLIBS = @GMOZ_LIB@
|
|
gtk2/gtk2mozilla.yate: MODFLAGS = $(MODRELAX)
|
|
|
|
rmanager.yate: LOCALFLAGS = $(COREDUMP_INC)
|
|
rmanager.yate: LOCALLIBS = $(COREDUMP_LIB)
|
|
|
|
../libyatess7.so:
|
|
$(MAKE) -C ../contrib/yss7
|
|
../contrib/yss7/libyatess7.a:
|
|
$(MAKE) -C ../contrib/yss7
|
|
|
|
../contrib/ilbc/libilbc.a:
|
|
$(MAKE) -C ../contrib/ilbc
|
|
|
|
../contrib/ysip/libyatesip.a:
|
|
$(MAKE) -C ../contrib/ysip
|
|
|
|
../contrib/yrtp/libyatertp.a:
|
|
$(MAKE) -C ../contrib/yrtp
|
|
|
|
../contrib/yiax/libyateiax.a:
|
|
$(MAKE) -C ../contrib/yiax
|
|
|
|
../contrib/yxml/libyatexml.a:
|
|
$(MAKE) -C ../contrib/yxml
|
|
|
|
../contrib/yjingle/libyatejingle.a:
|
|
$(MAKE) -C ../contrib/yjingle
|
|
|
|
../contrib/ypbx/libyatepbx.a:
|
|
$(MAKE) -C ../contrib/ypbx
|