moved the asn1 and facility portions of code to mISDNuser, so removing the files...
[asterisk/asterisk.git] / channels / Makefile
1 #
2 # Asterisk -- A telephony toolkit for Linux.
3
4 # Makefile for channel drivers
5 #
6 # Copyright (C) 1999-2006, Digium, Inc.
7 #
8 # This program is free software, distributed under the terms of
9 # the GNU General Public License
10 #
11
12 ifneq ($(wildcard ../menuselect.makeopts),)
13   include ../menuselect.makeopts
14   include ../menuselect.makedeps
15 endif
16
17 C_MODS:=$(filter-out $(MENUSELECT_CHANNELS),$(patsubst %.c,%,$(wildcard chan_*.c)))
18 CC_MODS:=$(filter-out $(MENUSELECT_CHANNELS),$(patsubst %.cc,%,$(wildcard chan_*.cc)))
19
20 ifeq ($(OSARCH),OpenBSD)
21   PTLIB=-lpt_OpenBSD_x86_r
22   H323LIB=-lh323_OpenBSD_x86_r
23 endif
24
25 ifeq ($(OSARCH),Linux)
26   PTLIB=-lpt_linux_x86_r
27   H323LIB=-lh323_linux_x86_r
28   CHANH323LIB=-ldl
29 endif
30
31 ifeq ($(OSARCH),FreeBSD)
32   PTLIB=-lpt_FreeBSD_x86_r
33   H323LIB=-lh323_FreeBSD_x86_r
34   CHANH323LIB=-pthread
35 endif
36
37 ifeq ($(OSARCH),NetBSD)
38   PTLIB=-lpt_NetBSD_x86_r
39   H323LIB=-lh323_NetBSD_x86_r
40 endif
41
42 ifeq ($(wildcard h323/libchanh323.a),)
43   CC_MODS:=$(filter-out chan_h323,$(CC_MODS))
44 endif
45
46 ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/mISDNuser/mISDNlib.h),)
47   C_MODS:=$(filter-out chan_misdn,$(C_MODS))
48 endif
49
50 ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libbnec.so),)
51   EC_CFLAGS=-DWITH_BEROEC
52   EC_LIBS=-lbnec
53 endif
54
55 ifndef OPENH323DIR
56   OPENH323DIR=$(HOME)/openh323
57 endif
58
59 ifndef PWLIBDIR
60   PWLIBDIR=$(HOME)/pwlib
61 endif
62
63 SELECTED_MODS:=$(C_MODS) $(CC_MODS)
64
65 all: _all
66
67 include $(ASTTOPDIR)/Makefile.moddir_rules
68
69 clean::
70         rm -f busy.h ringtone.h gentone
71
72 ifneq ($(wildcard $(PWD)/Makefile.ast),)
73   include $(PWD)/Makefile.ast
74 endif
75
76 $(eval $(call ast_make_final_host,gentone,gentone.c))
77 gentone: LIBS+=-lm
78
79 busy.h: gentone
80         ./gentone busy 480 620
81
82 ringtone.h: gentone
83         ./gentone ringtone 440 480
84
85 chan_oss.o: busy.h ringtone.h
86
87 chan_iax2.so: iax2-parser.o iax2-provision.o
88
89 chan_alsa.o: busy.h ringtone.h
90
91 ifeq ($(OSARCH),Linux)
92 chan_h323.so: chan_h323.o h323/libchanh323.a $(PWD)/Makefile.ast
93         $(CC) $(SOLINK) $(H323LDFLAGS) -o $@ $< h323/libchanh323.a $(H323LDLIBS) -lstdc++
94 else
95 chan_h323.so: chan_h323.o h323/libchanh323.a
96         $(CC) $(SOLINK) -o $@ $< h323/libchanh323.a $(CHANH323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L$(OPENH323DIR)/lib $(H323LIB) -L/usr/lib -lcrypto -lssl -lexpat
97 endif
98
99 misdn/chan_misdn_lib.a:
100         make -C misdn
101
102 chan_misdn.o: CFLAGS+=-Imisdn -DCHAN_MISDN_VERSION=\"0.3.0\" $(EC_CFLAGS)
103
104 misdn_config.o: CFLAGS+=-Imisdn -DCHAN_MISDN_VERSION=\"0.3.0\" $(EC_CFLAGS)
105
106 chan_misdn.so: chan_misdn.o misdn_config.o misdn/chan_misdn_lib.a
107 chan_misdn.so: LIBS+=-lisdnnet -lmISDN -lsuppserv $(EC_LIBS)