2007-05-16 20:36:40 +00: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.
|
|
|
|
|
2007-05-26 04:44:41 +00:00
|
|
|
SRC=src
|
|
|
|
OBJS=\
|
|
|
|
$(SRC)/hashtable.o \
|
|
|
|
$(SRC)/hashtable_itr.o \
|
|
|
|
$(SRC)/zap_io.o \
|
|
|
|
$(SRC)/zap_isdn.o \
|
|
|
|
$(SRC)/zap_analog.o \
|
|
|
|
$(SRC)/zap_config.o \
|
2007-06-05 00:57:02 +00:00
|
|
|
$(SRC)/zap_callerid.o \
|
2007-06-05 04:37:50 +00:00
|
|
|
$(SRC)/fsk.o \
|
|
|
|
$(SRC)/uart.o \
|
2007-05-26 04:44:41 +00:00
|
|
|
$(SRC)/g711.o \
|
|
|
|
$(SRC)/libteletone_detect.o \
|
|
|
|
$(SRC)/libteletone_generate.o \
|
|
|
|
$(SRC)/zap_buffer.o \
|
|
|
|
$(SRC)/zap_threadmutex.o \
|
|
|
|
$(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 \
|
2007-06-05 04:37:50 +00:00
|
|
|
$(SRC)/isdn/Q932mes.o \
|
|
|
|
$(SRC)/zap_zt.o \
|
|
|
|
$(SRC)/zap_wanpipe.o
|
|
|
|
|
2007-06-06 23:05:36 +00:00
|
|
|
#SRCS=$(shell echo $(OBJS) | sed "s/\.o/\.c/g")
|
2007-05-26 04:44:41 +00:00
|
|
|
|
2007-06-06 22:58:13 +00:00
|
|
|
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/wanpipe_tdm_api_iface.h \
|
|
|
|
$(SRC)/include/zap_analog.h \
|
|
|
|
$(SRC)/include/zap_buffer.h \
|
|
|
|
$(SRC)/include/zap_config.h \
|
|
|
|
$(SRC)/include/zap_isdn.h \
|
|
|
|
$(SRC)/include/zap_skel.h \
|
|
|
|
$(SRC)/include/zap_threadmutex.h \
|
|
|
|
$(SRC)/include/zap_types.h \
|
|
|
|
$(SRC)/include/zap_wanpipe.h \
|
|
|
|
$(SRC)/include/zap_zt.h \
|
|
|
|
$(SRC)/isdn/include/mfifo.h \
|
|
|
|
$(SRC)/isdn/include/national.h \
|
|
|
|
$(SRC)/isdn/include/Q921.h \
|
|
|
|
$(SRC)/isdn/include/Q931.h \
|
|
|
|
$(SRC)/isdn/include/Q931ie.h \
|
|
|
|
$(SRC)/isdn/include/Q932.h
|
|
|
|
|
2007-05-24 18:16:04 +00:00
|
|
|
|
2007-05-22 22:07:05 +00:00
|
|
|
PWD=$(shell pwd)
|
2007-06-05 04:37:50 +00:00
|
|
|
INCS=-I$(PWD)/$(SRC)//include -I$(PWD)/$(SRC)//isdn/include
|
2007-05-22 22:07:05 +00:00
|
|
|
CFLAGS=$(ZAP_CFLAGS) $(INCS)
|
2007-05-16 20:36:40 +00:00
|
|
|
MYLIB=libopenzap.a
|
2007-05-26 04:58:35 +00:00
|
|
|
LIBPRIA=libpri.a
|
|
|
|
LIBPRI=./libpri
|
|
|
|
TMP=-I$(LIBPRI) -I$(SRC)/include -I./src -w
|
2007-05-16 20:36:40 +00:00
|
|
|
|
2007-06-05 04:37:50 +00:00
|
|
|
include general.makefile
|
2007-05-16 20:36:40 +00:00
|
|
|
|
2007-05-17 03:31:21 +00:00
|
|
|
all: $(MYLIB)
|
|
|
|
|
2007-05-24 18:16:04 +00:00
|
|
|
$(MYLIB): $(OBJS) $(HEADERS)
|
2007-06-06 22:58:13 +00:00
|
|
|
ar rcs $(MYLIB) $(OBJS)
|
2007-05-16 20:36:40 +00:00
|
|
|
ranlib $(MYLIB)
|
|
|
|
|
2007-05-26 04:44:41 +00:00
|
|
|
testapp: $(SRC)/testapp.c $(MYLIB)
|
|
|
|
$(CC) $(INCS) -L. $(SRC)/testapp.c -o testapp -lopenzap -lm -lpthread
|
2007-05-17 16:57:26 +00:00
|
|
|
|
2007-06-05 00:57:02 +00:00
|
|
|
testcid: $(SRC)/testcid.c $(MYLIB)
|
2007-06-08 23:42:28 +00:00
|
|
|
$(CC) $(INCS) -L. -g -ggdb $(SRC)/testcid.c -o testcid -lopenzap -lm -lpthread
|
2007-06-05 00:57:02 +00:00
|
|
|
|
2007-06-06 22:58:13 +00:00
|
|
|
testtones: $(SRC)/testtones.c $(MYLIB)
|
|
|
|
$(CC) $(INCS) -L. $(SRC)/testtones.c -o testtones -lopenzap -lm -lpthread
|
|
|
|
|
2007-05-26 04:44:41 +00:00
|
|
|
testisdn: $(SRC)/testisdn.c $(MYLIB)
|
|
|
|
$(CC) $(INCS) -L. $(SRC)/testisdn.c -o testisdn -lopenzap -lm -lpthread
|
2007-05-18 17:50:37 +00:00
|
|
|
|
2007-05-26 04:44:41 +00:00
|
|
|
testanalog: $(SRC)/testanalog.c $(MYLIB)
|
|
|
|
$(CC) $(INCS) -L. $(SRC)/testanalog.c -o testanalog -lopenzap -lm -lpthread
|
2007-05-24 03:42:40 +00:00
|
|
|
|
2007-05-26 04:58:35 +00:00
|
|
|
$(SRC)/priserver.o: $(SRC)/priserver.c
|
2007-05-26 04:44:41 +00:00
|
|
|
$(CC) $(INCS) $(TMP) -c $(SRC)/priserver.c -o $(SRC)/priserver.o
|
2007-05-18 17:50:37 +00:00
|
|
|
|
2007-05-26 04:44:41 +00:00
|
|
|
$(SRC)/sangoma_pri.o: $(SRC)/sangoma_pri.c
|
|
|
|
$(CC) $(INCS) $(TMP) -c $(SRC)/sangoma_pri.c -o $(SRC)/sangoma_pri.o
|
2007-05-18 17:50:37 +00:00
|
|
|
|
2007-05-26 04:58:35 +00:00
|
|
|
$(LIBPRI)/$(LIBPRIA):
|
|
|
|
cd libpri && make
|
|
|
|
|
|
|
|
priserver: $(MYLIB) $(SRC)/priserver.o $(SRC)/sangoma_pri.o $(LIBPRI)/$(LIBPRIA)
|
|
|
|
$(CC) $(SRC)/sangoma_pri.o $(SRC)/priserver.o -L. -o priserver -lopenzap -lm -lpthread $(LIBPRI)/$(LIBPRIA)
|
2007-05-18 17:50:37 +00:00
|
|
|
|
2007-05-26 04:44:41 +00:00
|
|
|
$(SRC)/zap_io.o: $(SRC)/zap_io.c
|
2007-05-17 14:56:12 +00:00
|
|
|
$(CC) $(MOD_CFLAGS) $(CC_CFLAGS) $(CFLAGS) -c $< -o $@
|
|
|
|
|
2007-06-06 23:05:36 +00:00
|
|
|
%.o: %.c $(HEADERS)
|
2007-05-17 03:31:21 +00:00
|
|
|
$(CC) $(CC_CFLAGS) $(CFLAGS) -c $< -o $@
|
2007-05-16 20:36:40 +00:00
|
|
|
|
2007-05-24 22:09:44 +00:00
|
|
|
dox:
|
|
|
|
cd docs && doxygen $(PWD)/docs/Doxygen.conf
|
2007-05-26 04:44:41 +00:00
|
|
|
|
2007-05-27 14:58:01 +00:00
|
|
|
mod_openzap/mod_openzap.so: $(MYLIB) mod_openzap/mod_openzap.c
|
2007-05-26 04:44:41 +00:00
|
|
|
cd mod_openzap && make
|
|
|
|
|
|
|
|
mod_openzap: mod_openzap/mod_openzap.so
|
|
|
|
|
|
|
|
mod_openzap-install: mod_openzap
|
|
|
|
cd mod_openzap && make install
|
|
|
|
|
|
|
|
mod_openzap-clean:
|
2007-05-26 04:58:35 +00:00
|
|
|
@if [ -f mod_openzap/mod_openzap.so ] ; then cd mod_openzap && make clean ; fi
|
2007-05-26 04:44:41 +00:00
|
|
|
|
|
|
|
clean: mod_openzap-clean
|
2007-06-06 22:58:13 +00:00
|
|
|
rm -f $(SRC)/*.o $(SRC)/isdn/*.o $(MYLIB) *~ \#* testapp testcid testtones priserver testisdn testanalog
|
2007-05-26 04:58:35 +00:00
|
|
|
@if [ -f $(LIBPRI)/$(LIBPRIA) ] ; then cd $(LIBPRI) && make clean ; fi
|
2007-05-16 20:36:40 +00:00
|
|
|
|