1999-12-01 05:25:44 +00:00
|
|
|
#
|
|
|
|
# Asterisk -- A telephony toolkit for Linux.
|
|
|
|
#
|
|
|
|
# Makefile for Channel backends (dynamically loaded)
|
|
|
|
#
|
1999-12-14 23:40:27 +00:00
|
|
|
# Copyright (C) 1999, Mark Spencer
|
1999-12-01 05:25:44 +00:00
|
|
|
#
|
|
|
|
# Mark Spencer <markster@linux-support.net>
|
|
|
|
#
|
|
|
|
# This program is free software, distributed under the terms of
|
|
|
|
# the GNU General Public License
|
|
|
|
#
|
|
|
|
|
2003-04-27 18:13:11 +00:00
|
|
|
OSARCH=$(shell uname -s)
|
|
|
|
|
2002-06-16 16:06:38 +00:00
|
|
|
CHANNEL_LIBS=chan_modem.so chan_iax.so chan_sip.so \
|
|
|
|
chan_modem_aopen.so chan_oss.so \
|
2002-09-02 15:20:28 +00:00
|
|
|
chan_modem_bestdata.so chan_modem_i4l.so \
|
2003-04-06 02:41:42 +00:00
|
|
|
chan_agent.so chan_mgcp.so chan_iax2.so \
|
|
|
|
chan_local.so
|
2000-01-03 17:02:23 +00:00
|
|
|
|
2002-06-16 16:06:38 +00:00
|
|
|
#
|
|
|
|
# If you really want VoFR you can have it :-P
|
|
|
|
#
|
|
|
|
#CHANNEL_LIBS+=chan_vofr
|
|
|
|
|
2000-01-03 17:02:23 +00:00
|
|
|
CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/ixjuser.h ] && echo chan_phone.so)
|
1999-12-01 05:25:44 +00:00
|
|
|
|
2000-04-06 16:17:14 +00:00
|
|
|
CFLAGS+=-Wno-missing-prototypes -Wno-missing-declarations
|
2000-07-04 15:50:00 +00:00
|
|
|
CFLAGS+=$(shell [ ! -f /usr/include/linux/if_wanpipe.h ] && echo " -DOLD_SANGOMA_API")
|
2002-02-16 19:23:59 +00:00
|
|
|
CHANNEL_LIBS+=$(shell [ -f /usr/include/alsa/asoundlib.h ] && echo "chan_alsa.so")
|
2001-08-15 01:46:30 +00:00
|
|
|
CFLAGS+=$(shell [ -f /usr/lib/libpri.so.1 ] && echo " -DZAPATA_PRI")
|
2003-02-07 19:23:19 +00:00
|
|
|
CFLAGS+=$(shell [ -f /usr/lib/libmfcr2.so.1 ] && echo " -DZAPATA_R2")
|
2002-02-16 19:23:59 +00:00
|
|
|
CFLAGS+=$(shell [ -f alsa-monitor.h ] && echo " -DALSA_MONITOR")
|
2001-08-15 01:46:30 +00:00
|
|
|
ZAPPRI=$(shell [ -f /usr/lib/libpri.so.1 ] && echo "-lpri")
|
2003-02-07 19:23:19 +00:00
|
|
|
ZAPR2=$(shell [ -f /usr/lib/libmfcr2.so.1 ] && echo "-lmfcr2")
|
|
|
|
CHANZAP=$(shell if [ -f .oldzap ]; then echo "chan_zap_old.c"; else echo "chan_zap.c"; fi)
|
2003-02-12 13:59:15 +00:00
|
|
|
ZAPLIB=$(shell if [ -f .oldzap ]; then echo "-lzap"; fi)
|
2003-03-16 06:00:11 +00:00
|
|
|
CFLAGS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo "-DIAX_TRUNKING")
|
2003-04-15 14:39:06 +00:00
|
|
|
CHANNEL_LIBS+=$(shell [ -f /usr/include/vpbapi.h ] && echo "chan_vpb.so" )
|
2000-04-06 16:17:14 +00:00
|
|
|
|
2002-02-16 19:23:59 +00:00
|
|
|
ALSA_SRC=chan_alsa.c
|
|
|
|
ALSA_SRC+=$(shell [ -f alsa-monitor.h ] && echo "alsa-monitor.h")
|
|
|
|
|
2001-12-25 21:12:07 +00:00
|
|
|
CFLAGS+=-DCRYPTO
|
2003-04-27 18:13:11 +00:00
|
|
|
CFLAGS+=-fPIC
|
2001-12-25 21:12:07 +00:00
|
|
|
|
1999-12-01 05:25:44 +00:00
|
|
|
CFLAGS+=#-DVOFRDUMPER
|
|
|
|
|
2001-03-06 18:14:52 +00:00
|
|
|
ZAPDIR=/usr/lib
|
2001-08-15 01:46:30 +00:00
|
|
|
|
2003-02-07 19:23:19 +00:00
|
|
|
CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo "chan_zap.so")
|
2001-03-06 18:14:52 +00:00
|
|
|
|
2003-02-07 19:23:19 +00:00
|
|
|
CHANNEL_LIBS+=$(shell [ -f /usr/include/nbs.h ] && echo "chan_nbs.so" )
|
|
|
|
|
|
|
|
#CFLAGS+=$(shell [ -f $(ZAPDIR)/libzap.a ] && echo "-I$(ZAPDIR)")
|
2001-03-06 18:14:52 +00:00
|
|
|
|
2003-05-06 00:00:20 +00:00
|
|
|
all: depend $(CHANNEL_LIBS)
|
1999-12-01 05:25:44 +00:00
|
|
|
|
|
|
|
clean:
|
2003-05-06 00:00:20 +00:00
|
|
|
rm -f *.so *.o .depend
|
2001-12-25 21:12:07 +00:00
|
|
|
rm -f busy.h ringtone.h gentone gentone-ulaw
|
1999-12-01 05:25:44 +00:00
|
|
|
|
|
|
|
%.so : %.o
|
|
|
|
$(CC) -shared -Xlinker -x -o $@ $<
|
|
|
|
|
2003-05-06 00:00:20 +00:00
|
|
|
include .depend
|
|
|
|
|
2001-04-30 04:42:40 +00:00
|
|
|
gentone: gentone.c
|
|
|
|
$(CC) -o gentone gentone.c -lm
|
|
|
|
|
2001-12-25 21:12:07 +00:00
|
|
|
gentone-ulaw: gentone-ulaw.c
|
|
|
|
$(CC) -o gentone-ulaw gentone-ulaw.c -lm
|
|
|
|
|
2001-04-30 04:42:40 +00:00
|
|
|
busy.h: gentone
|
|
|
|
./gentone busy 480 620
|
|
|
|
|
|
|
|
ringtone.h: gentone
|
|
|
|
./gentone ringtone 440 480
|
|
|
|
|
|
|
|
chan_oss.o: chan_oss.c busy.h ringtone.h
|
2000-07-04 15:50:00 +00:00
|
|
|
|
2003-03-16 22:37:31 +00:00
|
|
|
chan_iax2.so: chan_iax2.o iax2-parser.o
|
2003-04-27 18:13:11 +00:00
|
|
|
ifeq (${OSARCH},Linux)
|
2003-03-16 22:37:31 +00:00
|
|
|
$(CC) -shared -Xlinker -x -o $@ chan_iax2.o iax2-parser.o
|
2003-04-27 18:13:11 +00:00
|
|
|
else
|
|
|
|
$(CC) -shared -Xlinker -x -o $@ chan_iax2.o iax2-parser.o -lossaudio
|
|
|
|
endif
|
2003-03-16 22:37:31 +00:00
|
|
|
|
2003-02-07 19:23:19 +00:00
|
|
|
chan_zap.o: $(CHANZAP)
|
|
|
|
$(CC) -c $(CFLAGS) -o chan_zap.o $(CHANZAP)
|
|
|
|
|
2001-08-15 01:46:30 +00:00
|
|
|
chan_zap.so: chan_zap.o
|
2003-02-07 19:23:19 +00:00
|
|
|
$(CC) -shared -Xlinker -x -o $@ $< $(ZAPPRI) $(ZAPR2) -ltonezone $(ZAPLIB)
|
2000-07-04 15:50:00 +00:00
|
|
|
|
2002-02-16 19:23:59 +00:00
|
|
|
chan_alsa.o: $(ALSA_SRC)
|
|
|
|
|
2003-04-15 14:39:06 +00:00
|
|
|
|
2002-02-16 19:23:59 +00:00
|
|
|
chan_alsa.so: chan_alsa.o
|
|
|
|
$(CC) -shared -Xlinker -x -o $@ $< -lasound -lm -ldl
|
|
|
|
|
2003-02-07 19:23:19 +00:00
|
|
|
chan_nbs.so: chan_nbs.o
|
|
|
|
$(CC) -shared -Xlinker -x -o $@ $< -lnbs
|
|
|
|
|
2003-04-15 14:39:06 +00:00
|
|
|
chan_vpb.o: chan_vpb.c
|
2003-04-18 14:34:46 +00:00
|
|
|
$(CXX) -c $(CFLAGS) -o $@ chan_vpb.c
|
2003-04-15 14:39:06 +00:00
|
|
|
|
|
|
|
chan_vpb.so: chan_vpb.o
|
2003-04-18 14:34:46 +00:00
|
|
|
$(CXX) -shared -Xlinker -x -o $@ $< -lvpb -lpthread -lm -ldl
|
2003-04-15 14:39:06 +00:00
|
|
|
|
2000-01-03 17:02:23 +00:00
|
|
|
#chan_modem.so : chan_modem.o
|
|
|
|
# $(CC) -rdynamic -shared -Xlinker -x -o $@ $<
|
|
|
|
|
1999-12-01 05:25:44 +00:00
|
|
|
install: all
|
|
|
|
for x in $(CHANNEL_LIBS); do $(INSTALL) -m 755 $$x $(MODULES_DIR) ; done
|
2003-05-06 00:00:20 +00:00
|
|
|
|
|
|
|
depend: .depend
|
|
|
|
|
|
|
|
.depend:
|
|
|
|
../mkdep $(CFLAGS) `ls *.c`
|
|
|
|
|