2008-02-17 16:52:17 -05:00
|
|
|
# Copyright (c) 2007, Anthony Minessale II
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions
|
|
|
|
# are met:
|
|
|
|
#
|
|
|
|
# * Redistributions of source code must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
#
|
|
|
|
# * Redistributions in binary form must reproduce the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer in the
|
|
|
|
# documentation and/or other materials provided with the distribution.
|
|
|
|
#
|
|
|
|
# * Neither the name of the original author; nor the names of any contributors
|
|
|
|
# may be used to endorse or promote products derived from this software
|
|
|
|
# without specific prior written permission.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
|
|
|
|
# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
|
|
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
|
|
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
|
|
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
|
|
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
|
|
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
|
|
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
2009-02-03 00:41:40 -05:00
|
|
|
PREFIX=$(prefix)
|
2009-02-02 11:47:44 -05:00
|
|
|
|
2008-02-17 16:52:17 -05:00
|
|
|
SRC=src
|
2009-02-03 01:16:53 -05:00
|
|
|
|
2008-09-16 21:22:24 -04:00
|
|
|
INCS=-I$(OZ_SRCDIR)/$(SRC)/include -I$(OZ_SRCDIR)/$(SRC)/isdn/include -I$(OZ_SRCDIR)/$(SRC)/ozmod/ozmod_ss7_boost
|
2009-02-03 00:41:40 -05:00
|
|
|
MY_CFLAGS = $(INCS) $(ZAP_CFLAGS) -DZAP_CONFIG_DIR=\"@prefix@/conf\" -DZAP_MOD_DIR=\"@prefix@/mod\" @COMP_VENDOR_CFLAGS@ @DEFS@
|
|
|
|
COMPILE = $(CC) $(MY_CFLAGS) $(INCS)
|
2008-09-06 01:46:14 -04:00
|
|
|
LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(COMPILE)
|
2009-02-03 01:16:53 -05:00
|
|
|
LINK = $(LIBTOOL) --mode=link --tag=CC $(CC) $(MY_CFLAGS) $(LDFLAGS) -o $@
|
2008-09-06 01:46:14 -04:00
|
|
|
|
2009-02-03 01:16:53 -05:00
|
|
|
libdir = $(PREFIX)/lib/
|
2009-02-03 00:41:40 -05:00
|
|
|
library_includedir = $(PREFIX)/include
|
|
|
|
|
|
|
|
libopenzap_la_SOURCES = \
|
2008-02-17 16:52:17 -05:00
|
|
|
$(SRC)/hashtable.c \
|
|
|
|
$(SRC)/hashtable_itr.c \
|
|
|
|
$(SRC)/zap_io.c \
|
|
|
|
$(SRC)/zap_config.c \
|
|
|
|
$(SRC)/zap_callerid.c \
|
|
|
|
$(SRC)/fsk.c \
|
|
|
|
$(SRC)/uart.c \
|
|
|
|
$(SRC)/g711.c \
|
|
|
|
$(SRC)/libteletone_detect.c \
|
|
|
|
$(SRC)/libteletone_generate.c \
|
|
|
|
$(SRC)/zap_buffer.c \
|
|
|
|
$(SRC)/zap_threadmutex.c \
|
2008-08-29 11:58:59 -04:00
|
|
|
$(SRC)/zap_dso.c
|
|
|
|
|
2009-02-03 00:41:40 -05:00
|
|
|
library_include_HEADERS = \
|
|
|
|
$(SRC)/include/fsk.h \
|
|
|
|
$(SRC)/include/g711.h \
|
|
|
|
$(SRC)/include/hashtable.h \
|
|
|
|
$(SRC)/include/hashtable_itr.h \
|
|
|
|
$(SRC)/include/hashtable_private.h \
|
|
|
|
$(SRC)/include/libteletone_detect.h \
|
|
|
|
$(SRC)/include/libteletone_generate.h \
|
|
|
|
$(SRC)/include/libteletone.h \
|
|
|
|
$(SRC)/include/openzap.h \
|
|
|
|
$(SRC)/include/sangoma_tdm_api.h \
|
|
|
|
$(SRC)/include/uart.h \
|
|
|
|
$(SRC)/include/zap_buffer.h \
|
|
|
|
$(SRC)/include/zap_config.h \
|
|
|
|
$(SRC)/include/zap_threadmutex.h \
|
|
|
|
$(SRC)/include/zap_dso.h \
|
|
|
|
$(SRC)/include/zap_types.h
|
|
|
|
|
|
|
|
lib_LTLIBRARIES = libopenzap.la
|
|
|
|
libopenzap_la_CFLAGS = $(AM_CFLAGS) $(MY_CFLAGS)
|
|
|
|
libopenzap_la_LDFLAGS = -version-info 1:0:0 $(AM_LDFLAGS)
|
|
|
|
libopenzap_la_LIBADD = $(LIBS)
|
2008-08-29 11:58:59 -04:00
|
|
|
|
2009-02-03 00:41:40 -05:00
|
|
|
MYLIB=libopenzap.la
|
2008-02-17 16:52:17 -05:00
|
|
|
|
2008-09-16 22:21:28 -04:00
|
|
|
all: $(MYLIB) analogmod analog_emmod isdnmod boostmod ztmod wpmod
|
2008-02-17 16:52:17 -05:00
|
|
|
|
2009-02-03 01:06:43 -05:00
|
|
|
noinst_PROGRAMS = testtones detect_tones detect_dtmf testisdn testboost testanalog #testapp testcid
|
|
|
|
#testapp_SOURCES = $(SRC)/testapp.c
|
|
|
|
#testapp_LDADD = libopenzap.la
|
|
|
|
#testapp_CFLAGS = $(AM_CFLAGS) $(MY_CFLAGS)
|
|
|
|
#testcid_SOURCES = $(SRC)/testcid.c
|
|
|
|
#testcid_LDADD = libopenzap.la
|
|
|
|
#testcid_CFLAGS = $(AM_CFLAGS) $(MY_CFLAGS)
|
|
|
|
testtones_SOURCES = $(SRC)/testtones.c
|
|
|
|
testtones_LDADD = libopenzap.la
|
|
|
|
testtones_CFLAGS = $(AM_CFLAGS) $(MY_CFLAGS)
|
|
|
|
detect_tones_SOURCES = $(SRC)/detect_tones.c
|
|
|
|
detect_tones_LDADD = libopenzap.la
|
|
|
|
detect_tones_CFLAGS = $(AM_CFLAGS) $(MY_CFLAGS)
|
|
|
|
detect_dtmf_SOURCES = $(SRC)/detect_dtmf.c
|
|
|
|
detect_dtmf_LDADD = libopenzap.la
|
|
|
|
detect_dtmf_CFLAGS = $(AM_CFLAGS) $(MY_CFLAGS)
|
|
|
|
testisdn_SOURCES = $(SRC)/testisdn.c
|
|
|
|
testisdn_LDADD = libopenzap.la
|
|
|
|
testisdn_CFLAGS = $(AM_CFLAGS) $(MY_CFLAGS)
|
|
|
|
testboost_SOURCES = $(SRC)/testboost.c
|
|
|
|
testboost_LDADD = libopenzap.la
|
|
|
|
testboost_CFLAGS = $(AM_CFLAGS) $(MY_CFLAGS)
|
|
|
|
testanalog_SOURCES = $(SRC)/testanalog.c
|
|
|
|
testanalog_LDADD = libopenzap.la
|
|
|
|
testanalog_CFLAGS = $(AM_CFLAGS) $(MY_CFLAGS)
|
2008-02-17 16:52:17 -05:00
|
|
|
|
|
|
|
|
2009-02-02 23:51:53 -05:00
|
|
|
%.o: %.c $(HEADER)
|
2008-09-06 18:10:15 -04:00
|
|
|
$(LTCOMPILE) -c $< -o $@
|
2008-02-17 16:52:17 -05:00
|
|
|
|
|
|
|
dox:
|
2008-09-06 20:08:01 -04:00
|
|
|
cd docs && doxygen $(OZ_SRCDIR)/docs/Doxygen.conf
|
2008-02-17 16:52:17 -05:00
|
|
|
|
2008-09-06 01:46:14 -04:00
|
|
|
mod_openzap/mod_openzap.$(DYNAMIC_LIB_EXTEN): $(MYLIB) mod_openzap/mod_openzap.c
|
2008-02-17 16:52:17 -05:00
|
|
|
cd mod_openzap && make
|
|
|
|
|
2008-09-06 01:46:14 -04:00
|
|
|
mod_openzap: mod_openzap/mod_openzap.$(DYNAMIC_LIB_EXTEN)
|
2008-02-17 16:52:17 -05:00
|
|
|
|
|
|
|
mod_openzap-install: mod_openzap
|
|
|
|
cd mod_openzap && make install
|
|
|
|
|
|
|
|
mod_openzap-clean:
|
2008-09-06 01:46:14 -04:00
|
|
|
@if [ -f mod_openzap/mod_openzap.$(DYNAMIC_LIB_EXTEN) ] ; then cd mod_openzap && make clean ; fi
|
2008-02-17 16:52:17 -05:00
|
|
|
|
2008-08-29 11:58:59 -04:00
|
|
|
clean:
|
2008-09-06 01:46:14 -04:00
|
|
|
rm -f $(SRC)/*.o $(SRC)/isdn/*.o $(MYLIB) *~ \#* testapp testcid testtones detect_tones detect_dtmf testisdn testboost testanalog src/ozmod/*/*.o src/ozmod/*/*.$(DYNAMIC_LIB_EXTEN)
|
2008-08-29 11:58:59 -04:00
|
|
|
|
2009-02-03 00:41:40 -05:00
|
|
|
install-data-local:
|
|
|
|
$(mkinstalldirs) $(DESTDIR)$(PREFIX)
|
|
|
|
$(mkinstalldirs) $(DESTDIR)$(PREFIX)/conf
|
2008-08-29 11:58:59 -04:00
|
|
|
@[ -f "$(DESTDIR)$(PREFIX)/conf/openzap.conf" ] || ( cp conf/*.conf $(DESTDIR)$(PREFIX)/conf)
|
2009-02-03 00:41:40 -05:00
|
|
|
$(mkinstalldirs) $(DESTDIR)$(PREFIX)/lib
|
|
|
|
$(mkinstalldirs) $(DESTDIR)$(PREFIX)/mod
|
2008-08-29 11:58:59 -04:00
|
|
|
@[ ! -f ozmod_* ] || cp -f ozmod_* $(DESTDIR)$(PREFIX)/mod
|
2008-09-06 01:46:14 -04:00
|
|
|
@cp -f src/ozmod/*/*.$(DYNAMIC_LIB_EXTEN) $(DESTDIR)$(PREFIX)/mod
|
2008-08-29 11:58:59 -04:00
|
|
|
@echo OpenZAP Installed
|
|
|
|
|
2008-09-16 21:22:24 -04:00
|
|
|
$(SRC)/ozmod/ozmod_skel/ozmod_skel.$(DYNAMIC_LIB_EXTEN): $(SRC)/ozmod/ozmod_skel/ozmod_skel.o $(MYLIB)
|
|
|
|
$(LINK) $(SOLINK) $(SRC)/ozmod/ozmod_skel/ozmod_skel.o $(MYLIB) -rpath $(libdir)
|
2008-09-06 01:46:14 -04:00
|
|
|
skelmod: $(SRC)/ozmod/ozmod_skel/ozmod_skel.$(DYNAMIC_LIB_EXTEN)
|
2008-08-29 11:58:59 -04:00
|
|
|
|
|
|
|
|
2008-09-16 21:22:24 -04:00
|
|
|
$(SRC)/ozmod/ozmod_zt/ozmod_zt.$(DYNAMIC_LIB_EXTEN): $(SRC)/ozmod/ozmod_zt/ozmod_zt.o $(MYLIB)
|
|
|
|
$(LINK) $(SOLINK) $(SRC)/ozmod/ozmod_zt/ozmod_zt.o $(MYLIB) -rpath $(libdir)
|
2008-09-06 01:46:14 -04:00
|
|
|
ztmod: $(SRC)/ozmod/ozmod_zt/ozmod_zt.$(DYNAMIC_LIB_EXTEN)
|
2008-08-29 11:58:59 -04:00
|
|
|
|
2008-09-16 21:22:24 -04:00
|
|
|
$(SRC)/ozmod/ozmod_wanpipe/ozmod_wanpipe.$(DYNAMIC_LIB_EXTEN): $(SRC)/ozmod/ozmod_wanpipe/ozmod_wanpipe.o $(MYLIB)
|
|
|
|
$(LINK) $(SOLINK) $(SRC)/ozmod/ozmod_wanpipe/ozmod_wanpipe.o $(MYLIB) -rpath $(libdir)
|
2008-09-06 01:46:14 -04:00
|
|
|
wpmod: $(SRC)/ozmod/ozmod_wanpipe/ozmod_wanpipe.$(DYNAMIC_LIB_EXTEN)
|
2008-08-29 11:58:59 -04:00
|
|
|
|
2009-02-03 01:16:53 -05:00
|
|
|
PIKA_DIR=$(shell ls -d /usr/include/pika 2>/dev/null)
|
|
|
|
PIKA_LIB=$(shell ls /usr/lib/libpikahmpapi.so 2>/dev/null)
|
|
|
|
|
2008-09-16 21:22:24 -04:00
|
|
|
$(SRC)/ozmod/ozmod_pika/ozmod_pika.$(DYNAMIC_LIB_EXTEN): $(SRC)/ozmod/ozmod_pika/ozmod_pika.o $(MYLIB)
|
|
|
|
$(LINK) $(SOLINK) $(SRC)/ozmod/ozmod_pika/ozmod_pika.o $(MYLIB) -rpath $(libdir)
|
2008-09-06 01:46:14 -04:00
|
|
|
pikamod: $(SRC)/ozmod/ozmod_pika/ozmod_pika.$(DYNAMIC_LIB_EXTEN)
|
2008-08-29 11:58:59 -04:00
|
|
|
|
2009-02-03 00:41:40 -05:00
|
|
|
###For libpcap
|
|
|
|
ISDN_CFLAGS = -D_GNU_SOURCE
|
|
|
|
####
|
|
|
|
|
|
|
|
###For libpcap
|
2009-02-03 12:00:13 -05:00
|
|
|
ISDN_LIBS = $(PCAP_LIB_FLAGS)
|
2009-02-03 00:41:40 -05:00
|
|
|
####
|
|
|
|
|
2009-02-03 01:16:53 -05:00
|
|
|
ISDN_SOURCE=\
|
|
|
|
$(SRC)/isdn/EuroISDNStateNT.c \
|
|
|
|
$(SRC)/isdn/EuroISDNStateTE.c \
|
|
|
|
$(SRC)/isdn/mfifo.c \
|
|
|
|
$(SRC)/isdn/Q921.c \
|
|
|
|
$(SRC)/isdn/Q931api.c \
|
|
|
|
$(SRC)/isdn/Q931.c \
|
|
|
|
$(SRC)/isdn/Q931ie.c \
|
|
|
|
$(SRC)/isdn/Q931mes.c \
|
|
|
|
$(SRC)/isdn/Q931StateNT.c \
|
|
|
|
$(SRC)/isdn/Q931StateTE.c \
|
|
|
|
$(SRC)/isdn/nationalmes.c \
|
|
|
|
$(SRC)/isdn/nationalStateNT.c \
|
|
|
|
$(SRC)/isdn/nationalStateTE.c \
|
|
|
|
$(SRC)/isdn/DMSmes.c \
|
|
|
|
$(SRC)/isdn/DMSStateNT.c \
|
|
|
|
$(SRC)/isdn/DMSStateTE.c \
|
|
|
|
$(SRC)/isdn/5ESSmes.c \
|
|
|
|
$(SRC)/isdn/5ESSStateNT.c \
|
|
|
|
$(SRC)/isdn/5ESSStateTE.c \
|
|
|
|
$(SRC)/isdn/Q932mes.c
|
|
|
|
|
|
|
|
ISDN_OBJS=\
|
|
|
|
$(SRC)/isdn/EuroISDNStateNT.o \
|
|
|
|
$(SRC)/isdn/EuroISDNStateTE.o \
|
|
|
|
$(SRC)/isdn/mfifo.o \
|
|
|
|
$(SRC)/isdn/Q921.o \
|
|
|
|
$(SRC)/isdn/Q931api.o \
|
|
|
|
$(SRC)/isdn/Q931.o \
|
|
|
|
$(SRC)/isdn/Q931ie.o \
|
|
|
|
$(SRC)/isdn/Q931mes.o \
|
|
|
|
$(SRC)/isdn/Q931StateNT.o \
|
|
|
|
$(SRC)/isdn/Q931StateTE.o \
|
|
|
|
$(SRC)/isdn/nationalmes.o \
|
|
|
|
$(SRC)/isdn/nationalStateNT.o \
|
|
|
|
$(SRC)/isdn/nationalStateTE.o \
|
|
|
|
$(SRC)/isdn/DMSmes.o \
|
|
|
|
$(SRC)/isdn/DMSStateNT.o \
|
|
|
|
$(SRC)/isdn/DMSStateTE.o \
|
|
|
|
$(SRC)/isdn/5ESSmes.o \
|
|
|
|
$(SRC)/isdn/5ESSStateNT.o \
|
|
|
|
$(SRC)/isdn/5ESSStateTE.o \
|
|
|
|
$(SRC)/isdn/Q932mes.o
|
|
|
|
|
|
|
|
ISDN_HEADER=\
|
|
|
|
$(SRC)/isdn/include/mfifo.h \
|
|
|
|
$(SRC)/isdn/include/national.h \
|
|
|
|
$(SRC)/isdn/include/DMS.h \
|
|
|
|
$(SRC)/isdn/include/5ESS.h \
|
|
|
|
$(SRC)/isdn/include/Q921.h \
|
|
|
|
$(SRC)/isdn/include/Q931.h \
|
|
|
|
$(SRC)/isdn/include/Q931ie.h \
|
|
|
|
$(SRC)/isdn/include/Q932.h
|
|
|
|
|
2009-02-02 23:51:53 -05:00
|
|
|
$(ISDN_OBJS): $(ISDN_HEADER) $(ISDN_SOURCE) $(SRC)/ozmod/ozmod_isdn/ozmod_isdn.c
|
2009-02-03 00:41:40 -05:00
|
|
|
$(SRC)/ozmod/ozmod_isdn/ozmod_isdn.o: $(SRC)/ozmod/ozmod_isdn/ozmod_isdn.c
|
|
|
|
$(LTCOMPILE) -c $< -o $@ $(ISDN_CFLAGS)
|
2008-08-29 11:58:59 -04:00
|
|
|
|
2008-09-16 21:22:24 -04:00
|
|
|
$(SRC)/ozmod/ozmod_isdn/ozmod_isdn.$(DYNAMIC_LIB_EXTEN): $(MYLIB) $(ISDN_OBJS) $(SRC)/ozmod/ozmod_isdn/ozmod_isdn.o
|
2009-02-03 00:41:40 -05:00
|
|
|
$(LINK) $(SOLINK) $(ISDN_OBJS) $(SRC)/ozmod/ozmod_isdn/ozmod_isdn.o $(MYLIB) $(ISDN_LIBS) -rpath $(libdir)
|
2008-09-06 01:46:14 -04:00
|
|
|
isdnmod: $(SRC)/ozmod/ozmod_isdn/ozmod_isdn.$(DYNAMIC_LIB_EXTEN)
|
2008-08-29 11:58:59 -04:00
|
|
|
|
2009-02-02 23:51:53 -05:00
|
|
|
$(ISDN_OBJS2): $(ISDN_HEADER) $(ISDN_SOURCE) $(SRC)/ozmod/ozmod_isdn_libpcap/ozmod_isdn.c
|
2009-01-30 06:37:11 -05:00
|
|
|
|
2008-09-16 21:22:24 -04:00
|
|
|
$(SRC)/ozmod/ozmod_analog/ozmod_analog.$(DYNAMIC_LIB_EXTEN): $(MYLIB) $(SRC)/ozmod/ozmod_analog/ozmod_analog.o
|
|
|
|
$(LINK) $(SOLINK) $(SRC)/ozmod/ozmod_analog/ozmod_analog.o $(MYLIB) -rpath $(libdir)
|
2008-09-06 01:46:14 -04:00
|
|
|
analogmod: $(SRC)/ozmod/ozmod_analog/ozmod_analog.$(DYNAMIC_LIB_EXTEN)
|
2008-08-29 11:58:59 -04:00
|
|
|
|
2008-09-16 22:21:28 -04:00
|
|
|
$(SRC)/ozmod/ozmod_analog_em/ozmod_analog_em.$(DYNAMIC_LIB_EXTEN): $(MYLIB) $(ANALOG_EM_OBJS) $(SRC)/ozmod/ozmod_analog_em/ozmod_analog_em.o
|
|
|
|
$(LINK) $(SOLINK) $(SRC)/ozmod/ozmod_analog_em/ozmod_analog_em.o $(MYLIB) -rpath $(libdir)
|
|
|
|
analog_emmod: $(SRC)/ozmod/ozmod_analog_em/ozmod_analog_em.$(DYNAMIC_LIB_EXTEN)
|
|
|
|
|
2009-02-03 01:16:53 -05:00
|
|
|
BOOST_OBJS=\
|
|
|
|
$(SRC)/ozmod/ozmod_ss7_boost/ss7_boost_client.o \
|
|
|
|
$(SRC)/ozmod/ozmod_ss7_boost/ozmod_ss7_boost.o
|
|
|
|
|
|
|
|
BOOST_SOURCE=\
|
|
|
|
$(SRC)/ozmod/ozmod_ss7_boost/ss7_boost_client.c \
|
|
|
|
$(SRC)/ozmod/ozmod_ss7_boost/ozmod_ss7_boost.c
|
|
|
|
|
2008-09-16 21:22:24 -04:00
|
|
|
$(SRC)/ozmod/ozmod_ss7_boost/ozmod_ss7_boost.$(DYNAMIC_LIB_EXTEN): $(MYLIB) $(BOOST_OBJS)
|
|
|
|
$(LINK) $(SOLINK) $(BOOST_OBJS) $(MYLIB) -rpath $(libdir)
|
2008-09-06 01:46:14 -04:00
|
|
|
boostmod: $(SRC)/ozmod/ozmod_ss7_boost/ozmod_ss7_boost.$(DYNAMIC_LIB_EXTEN)
|
2008-08-29 11:58:59 -04:00
|
|
|
|
|
|
|
|