Add preliminary chan_local, fix chan_sip to delete unknown calls
[asterisk/asterisk.git] / channels / Makefile
1 #
2 # Asterisk -- A telephony toolkit for Linux.
3
4 # Makefile for Channel backends (dynamically loaded)
5 #
6 # Copyright (C) 1999, Mark Spencer
7 #
8 # Mark Spencer <markster@linux-support.net>
9 #
10 # This program is free software, distributed under the terms of
11 # the GNU General Public License
12 #
13
14 CHANNEL_LIBS=chan_modem.so chan_iax.so chan_sip.so \
15              chan_modem_aopen.so chan_oss.so \
16              chan_modem_bestdata.so chan_modem_i4l.so \
17              chan_agent.so chan_mgcp.so chan_iax2.so \
18              chan_local.so
19
20 #
21 # If you really want VoFR you can have it :-P
22 #
23 #CHANNEL_LIBS+=chan_vofr
24
25 CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/ixjuser.h ] && echo chan_phone.so)
26
27 CFLAGS+=-Wno-missing-prototypes -Wno-missing-declarations
28 CFLAGS+=$(shell [ ! -f /usr/include/linux/if_wanpipe.h ] && echo " -DOLD_SANGOMA_API")
29 CHANNEL_LIBS+=$(shell [ -f /usr/include/alsa/asoundlib.h ] && echo "chan_alsa.so")
30 CFLAGS+=$(shell [ -f /usr/lib/libpri.so.1 ] && echo " -DZAPATA_PRI")
31 CFLAGS+=$(shell [ -f /usr/lib/libmfcr2.so.1 ] && echo " -DZAPATA_R2")
32 CFLAGS+=$(shell [ -f alsa-monitor.h ] && echo " -DALSA_MONITOR")
33 ZAPPRI=$(shell [ -f /usr/lib/libpri.so.1 ] && echo "-lpri")
34 ZAPR2=$(shell [ -f /usr/lib/libmfcr2.so.1 ] && echo "-lmfcr2")
35 CHANZAP=$(shell if [ -f .oldzap ]; then echo "chan_zap_old.c"; else echo "chan_zap.c"; fi)
36 ZAPLIB=$(shell if [ -f .oldzap ]; then echo "-lzap"; fi)
37 CFLAGS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo "-DIAX_TRUNKING")
38
39 ALSA_SRC=chan_alsa.c
40 ALSA_SRC+=$(shell [ -f alsa-monitor.h ] && echo "alsa-monitor.h")
41
42 CFLAGS+=-DCRYPTO
43
44 CFLAGS+=#-DVOFRDUMPER
45
46 ZAPDIR=/usr/lib
47
48 CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo "chan_zap.so")
49
50 CHANNEL_LIBS+=$(shell [ -f /usr/include/nbs.h ] && echo "chan_nbs.so" )
51
52 #CFLAGS+=$(shell [ -f $(ZAPDIR)/libzap.a ] && echo "-I$(ZAPDIR)")
53
54 all: $(CHANNEL_LIBS) 
55
56 clean:
57         rm -f *.so *.o
58         rm -f busy.h ringtone.h gentone gentone-ulaw
59
60 %.so : %.o
61         $(CC) -shared -Xlinker -x -o $@ $<
62
63 gentone: gentone.c
64         $(CC) -o gentone gentone.c -lm
65
66 gentone-ulaw: gentone-ulaw.c
67         $(CC) -o gentone-ulaw gentone-ulaw.c -lm
68
69 busy.h: gentone
70         ./gentone busy 480 620
71
72 ringtone.h: gentone
73         ./gentone ringtone 440 480
74
75 chan_oss.o: chan_oss.c  busy.h ringtone.h
76
77 chan_iax2.so: chan_iax2.o iax2-parser.o
78         $(CC) -shared -Xlinker -x -o $@ chan_iax2.o iax2-parser.o
79
80 chan_zap.o: $(CHANZAP)
81         $(CC) -c $(CFLAGS) -o chan_zap.o $(CHANZAP)
82
83 chan_zap.so: chan_zap.o
84         $(CC) -shared -Xlinker -x -o $@ $<  $(ZAPPRI) $(ZAPR2) -ltonezone $(ZAPLIB)
85
86 chan_alsa.o: $(ALSA_SRC)
87
88 chan_alsa.so: chan_alsa.o
89         $(CC) -shared -Xlinker -x -o $@ $< -lasound -lm -ldl
90
91 chan_nbs.so: chan_nbs.o
92         $(CC) -shared -Xlinker -x -o $@ $< -lnbs
93
94 #chan_modem.so : chan_modem.o
95 #       $(CC) -rdynamic -shared -Xlinker -x -o $@ $<
96
97 install: all
98         for x in $(CHANNEL_LIBS); do $(INSTALL) -m 755 $$x $(MODULES_DIR) ; done