stasic.c: Fix printf format type mismatches with arguments.
[asterisk/asterisk.git] / channels / Makefile
index 8425ff6..96421d8 100644 (file)
 #
-# Asterisk -- A telephony toolkit for Linux.
-# 
+# Asterisk -- An open source telephony toolkit.
+#
 # Makefile for channel drivers
 #
 # Copyright (C) 1999-2006, Digium, Inc.
 #
-# Mark Spencer <markster@digium.com>
-#
-# Edited By Belgarath <> Aug 28 2004
-# Added bare bones ultrasparc-linux support.
-#
 # This program is free software, distributed under the terms of
 # the GNU General Public License
 #
 
-MODS:=$(patsubst %.c,%.so,$(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
-
-ifeq (${OSARCH},CYGWIN)
-  CYGSOLINK=-Wl,--out-implib=lib$@.a -Wl,--export-all-symbols
-  CYGSOLIB=-L.. -L. -L../res -lasterisk.dll -lres_features.so
-  CYG_CHAN_AGENT=-lres_monitor.so
-endif
-
-ifeq ($(PROC),sparc64)
-  PROC=ultrasparc
-  CFLAGS += -mtune=$(PROC) -O3 -pipe -fomit-frame-pointer -mcpu=v8
-endif
-
-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 (${OSARCH},Darwin)
-  MODS:=$(filter-out chan_oss.so,$(MODS))
-endif
-
-ifeq (${OSARCH},SunOS)
-  MODS:=$(filter-out chan_oss.so,$(MODS))
-  SOLINK+=-lrt
-endif
-
-ifeq (${OSARCH},CYGWIN)
-  MODS:=$(filter-out chan_oss.so,$(MODS))
-endif
-
-ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/ixjuser.h $(CROSS_COMPILE_TARGET)/usr/local/include/ixjuser.h),)
-  MODS:=$(filter-out chan_phone.so,$(MODS))
-endif
-
-ifeq (${WITH_SMDI},1)
-CFLAGS+=-DWITH_SMDI
-endif
-
-ifeq ($(wildcard h323/libchanh323.a),)
-  MODS:=$(filter-out chan_h323.so,$(MODS))
-endif
-
-ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/mISDNuser/mISDNlib.h),)
-  MODS:=$(filter-out chan_misdn.so,$(MODS))
-else
-  CFLAGS+=-Imisdn 
-endif
-
-CFLAGS+=-Wno-missing-prototypes -Wno-missing-declarations
-
-ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/alsa/asoundlib.h),)
-  MODS:=$(filter-out chan_alsa.so,$(MODS))
-endif
-
-ifndef WITHOUT_PRI
-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libpri.so.1 $(CROSS_COMPILE_TARGET)/usr/local/lib/libpri.so.1),)
-  CFLAGS+=-DZAPATA_PRI
-  ZAPPRI=-lpri
-endif
-endif # WITHOUT_PRI
-
-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libmfcr2.so.1 $(CROSS_COMPILE_TARGET)/usr/local/lib/libmfcr2.so.1),)
-  CFLAGS+=-DZAPATA_R2
-  ZAPR2=-lmfcr2
-endif
+-include $(ASTTOPDIR)/menuselect.makeopts $(ASTTOPDIR)/menuselect.makedeps
 
-ALSA_SRC=chan_alsa.c
+MODULE_PREFIX=chan
+MENUSELECT_CATEGORY=CHANNELS
+MENUSELECT_DESCRIPTION=Channel Drivers
 
-ifneq ($(wildcard alsa-monitor.h),)
-  CFLAGS+=-DALSA_MONITOR
-  ALSA_SRC+=alsa-monitor.h
-endif
+all: _all
 
-ifndef WITHOUT_ZAPTEL
-ZAPAVAIL:=$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h)
-endif
+include $(ASTTOPDIR)/Makefile.moddir_rules
 
-ifeq (${ZAPAVAIL},)
-  MODS:=$(filter-out chan_zap.so,$(MODS))
-else
-  ifeq (${OSARCH},NetBSD)
-    SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/pkg/lib
-  endif
-  ifeq (${OSARCH},FreeBSD)
-    SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
-  endif
-  CFLAGS+=-DIAX_TRUNKING
+ifneq ($(findstring $(OSARCH), mingw32 cygwin ),)
+  LIBS+= -lres_monitor.so
 endif
 
-ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/vpbapi.h),)
-  MODS:=$(filter-out chan_vpb.so,$(MODS))
-else
-  CFLAGS+=-DLINUX
-endif
-
-CFLAGS+=-DCRYPTO
-
-ifneq ($(OSARCH),CYGWIN)
-  CFLAGS+=-fPIC
-endif
-
-CFLAGS+=#-DVOFRDUMPER
-
-ZAPDIR=/usr/lib
-
-ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/nbs.h),)
-  MODS:=$(filter-out chan_nbs.so,$(MODS))
-endif
-
-ifndef OPENH323DIR
-  OPENH323DIR=$(HOME)/openh323
-endif
-
-ifndef PWLIBDIR
-  PWLIBDIR=$(HOME)/pwlib
-endif
-
-all: depend $(MODS) 
-
-clean:
-       rm -f *.so *.o .depend
-       rm -f busy.h ringtone.h gentone gentone-ulaw
-
-%.so : %.o
-       $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} ${LIBS}
-
-ifneq ($(wildcard .depend),)
-  include .depend
-endif
-
-ifneq ($(wildcard h323/Makefile.ast),)
-  include h323/Makefile.ast
-endif
-
-ifneq ($(wildcard misdn/Makefile.ast),)
-  include misdn/Makefile.ast
-endif
-
-gentone: gentone.c
-       $(HOST_CC) -o gentone gentone.c -lm
-
-gentone-ulaw: gentone-ulaw.c
-       $(HOST_CC) -o gentone-ulaw gentone-ulaw.c -lm
-
-busy.h: gentone
-       ./gentone busy 480 620
-
-ringtone.h: gentone
-       ./gentone ringtone 440 480
-
-chan_oss.o: chan_oss.c busy.h ringtone.h
-
-chan_alsa.o: chan_alsa.c busy.h ringtone.h
-
-ifeq (${OSARCH},OpenBSD)
-chan_oss.so: chan_oss.o
-       $(CC) $(SOLINK) -o $@ chan_oss.o -lossaudio
-endif
-ifeq (${OSARCH},NetBSD)
-chan_oss.so: chan_oss.o
-       $(CC) $(SOLINK) -o $@ chan_oss.o -lossaudio
-endif
-
-chan_iax2.so: chan_iax2.o iax2-parser.o iax2-provision.o
-       $(CC) $(SOLINK) -o $@ ${CYGSOLINK} chan_iax2.o iax2-parser.o iax2-provision.o ${CYGSOLIB}
-
-chan_zap.o: chan_zap.c
-       $(CC) -c $(CFLAGS) -o chan_zap.o chan_zap.c
-
-chan_zap.so: chan_zap.o
-       $(CC) $(SOLINK) -o $@ $<  $(ZAPPRI) $(ZAPR2) -ltonezone
-
-chan_sip.so: chan_sip.o
-       $(CC) $(SOLINK) -o $@ ${CYGSOLINK} chan_sip.o ${CYGSOLIB}
-
-chan_agent.so: chan_agent.o
-       $(CC) $(SOLINK) -o $@ ${CYGSOLINK} chan_agent.o ${CYGSOLIB} ${CYG_CHAN_AGENT}
-
-chan_alsa.o: $(ALSA_SRC)
-
-chan_alsa.so: chan_alsa.o
-       $(CC) $(SOLINK) -o $@ $< -lasound -lm -ldl
-
-chan_nbs.so: chan_nbs.o
-       $(CC) $(SOLINK) -o $@ $< -lnbs
-
-chan_vpb.o: chan_vpb.c
-       $(CXX) -c $(CFLAGS) -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
-
-misdn/chan_misdn_lib.a:
-       make -C misdn
-
-chan_misdn.so: chan_misdn.o chan_misdn_config.o misdn/chan_misdn_lib.a
-       $(CC) -shared -Xlinker -x -L/usr/lib -o $@ $^ -lisdnnet -lmISDN
-
-chan_misdn.o: chan_misdn.c
-       $(CC) $(CFLAGS) -DCHAN_MISDN_VERSION=\"0.3.0\" -c $< -o $@
-
-chan_misdn_config.o: chan_misdn_config.c misdn/chan_misdn_config.h
-       $(CC) $(CFLAGS) -DCHAN_MISDN_VERSION=\"0.3.0\" -c $< -o $@
-
-
-install: all
-       for x in $(MODS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
-
-uninstall:
+$(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)
 
-depend: .depend
+chan_dahdi.o: _ASTCFLAGS+=$(call get_menuselect_cflags,LOTS_OF_SPANS)
+chan_mgcp.o: _ASTCFLAGS+=$(AST_NO_FORMAT_TRUNCATION)
+chan_unistim.o: _ASTCFLAGS+=$(AST_NO_FORMAT_TRUNCATION)
+chan_phone.o: _ASTCFLAGS+=$(AST_NO_FORMAT_TRUNCATION)
+chan_sip.o: _ASTCFLAGS+=$(AST_NO_FORMAT_TRUNCATION)
 
-.depend:
-       ../build_tools/mkdep $(CFLAGS) `ls *.c`
+chan_misdn.o: _ASTCFLAGS+=-Imisdn
+misdn_config.o: _ASTCFLAGS+=-Imisdn
+misdn/isdn_lib.o: _ASTCFLAGS+=-Wno-strict-aliasing
 
-env:
-       env
+$(call MOD_ADD_C,chan_oss,console_video.c vgrabbers.c console_board.c)