Make --with-pjproject-bundled the default for Asterisk 15
[asterisk/asterisk.git] / channels / Makefile
index 5af2f3c..242d3f4 100644 (file)
@@ -1,6 +1,6 @@
 #
-# Asterisk -- A telephony toolkit for Linux.
-# 
+# Asterisk -- An open source telephony toolkit.
+#
 # Makefile for channel drivers
 #
 # Copyright (C) 1999-2006, Digium, Inc.
 # the GNU General Public License
 #
 
-ifneq ($(wildcard ../menuselect.makeopts),)
-  include ../menuselect.makeopts
-  include ../menuselect.makedeps
-endif
-
-SELECTED_MODS:=$(filter-out $(MENUSELECT_CHANNELS),$(patsubst %.c,%,$(wildcard chan_*.c)))
-
-ifeq ($(OSARCH),OpenBSD)
-  PTLIB=-lpt_OpenBSD_x86_r
-  H323LIB=-lh323_OpenBSD_x86_r
-endif
-
-ifeq ($(OSARCH),Linux)
-  PTLIB=-lpt_linux_x86_r
-  H323LIB=-lh323_linux_x86_r
-  CHANH323LIB=-ldl
-endif
+-include $(ASTTOPDIR)/menuselect.makeopts $(ASTTOPDIR)/menuselect.makedeps
 
-ifeq ($(OSARCH),FreeBSD)
-  PTLIB=-lpt_FreeBSD_x86_r
-  H323LIB=-lh323_FreeBSD_x86_r
-  CHANH323LIB=-pthread
-endif
-
-ifeq ($(OSARCH),NetBSD)
-  PTLIB=-lpt_NetBSD_x86_r
-  H323LIB=-lh323_NetBSD_x86_r
-endif
-
-ifeq ($(wildcard h323/libchanh323.a),)
-  SELECTED_MODS:=$(filter-out chan_h323,$(SELECTED_MODS))
-endif
-
-ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/mISDNuser/mISDNlib.h),)
-  SELECTED_MODS:=$(filter-out chan_misdn,$(SELECTED_MODS))
-else
-  CFLAGS+=-Imisdn 
-endif
-
-ifndef OPENH323DIR
-  OPENH323DIR=$(HOME)/openh323
-endif
-
-ifndef PWLIBDIR
-  PWLIBDIR=$(HOME)/pwlib
-endif
-
-MENUSELECT_OPTS_chan_misdn+=CHAN_MISDN_VERSION=\"0.3.0\"
+MODULE_PREFIX=chan
+MENUSELECT_CATEGORY=CHANNELS
+MENUSELECT_DESCRIPTION=Channel Drivers
 
 all: _all
 
-include ../Makefile.rules
-
-clean::
-       rm -f busy.h ringtone.h gentone gentone-ulaw
-
-ifneq ($(wildcard h323/Makefile.ast),)
-  include h323/Makefile.ast
-endif
+include $(ASTTOPDIR)/Makefile.moddir_rules
 
-ifneq ($(wildcard misdn/Makefile.ast),)
-  include misdn/Makefile.ast
+ifneq ($(findstring $(OSARCH), mingw32 cygwin ),)
+  LIBS+= -lres_monitor.so
 endif
 
-gentone gentone-ulaw: %: %.c
-       $(HOST_CC) -o $@ $< -lm
+$(call MOD_ADD_C,chan_iax2,$(wildcard iax2/*.c))
+$(call MOD_ADD_C,chan_sip,$(wildcard sip/*.c))
+$(call MOD_ADD_C,chan_pjsip,$(wildcard pjsip/*.c))
+$(call MOD_ADD_C,chan_dahdi,$(wildcard dahdi/*.c) sig_analog.c sig_pri.c sig_ss7.c)
+$(call MOD_ADD_C,chan_misdn,misdn_config.c misdn/isdn_lib.c misdn/isdn_msg_parser.c)
 
-busy.h: gentone
-       ./gentone busy 480 620
+chan_mgcp.o: _ASTCFLAGS+=$(AST_NO_FORMAT_TRUNCATION)
 
-ringtone.h: gentone
-       ./gentone ringtone 440 480
-
-chan_oss.o: chan_oss.c busy.h ringtone.h
-
-chan_iax2.so: iax2-parser.o iax2-provision.o
-
-chan_alsa.o: busy.h ringtone.h
-
-chan_vpb.o: chan_vpb.c
-       $(CXX) -c $(CFLAGS:-Werror=) -o $@ chan_vpb.c
-
-chan_vpb.so: chan_vpb.o
-        $(CXX) $(SOLINK) -o $@ $< -lvpb -lpthread -lm -ldl
-
-ifeq ($(OSARCH),Linux)
-chan_h323.so: chan_h323.o h323/libchanh323.a h323/Makefile.ast
-       $(CC) $(SOLINK) $(H323LDFLAGS) -o $@ $< h323/libchanh323.a $(H323LDLIBS) -lstdc++
-else
-chan_h323.so: chan_h323.o h323/libchanh323.a
-       $(CC) $(SOLINK) -o $@ $< h323/libchanh323.a $(CHANH323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L$(OPENH323DIR)/lib $(H323LIB) -L/usr/lib -lcrypto -lssl -lexpat
-endif
+chan_misdn.o: _ASTCFLAGS+=-Imisdn
+misdn_config.o: _ASTCFLAGS+=-Imisdn
+misdn/isdn_lib.o: _ASTCFLAGS+=-Wno-strict-aliasing
 
-misdn/chan_misdn_lib.a:
-       make -C misdn
+$(call MOD_ADD_C,chan_oss,console_video.c vgrabbers.c console_board.c)
 
-chan_misdn.so: misdn_config.o misdn/chan_misdn_lib.a
-       $(CC) $(SOLINK) -o $@ $^ -lisdnnet -lmISDN