1999-12-05 01:40:43 +00:00
|
|
|
#
|
|
|
|
# Asterisk -- A telephony toolkit for Linux.
|
|
|
|
#
|
2005-06-20 17:26:08 +00:00
|
|
|
# Makefile for codec modules
|
1999-12-05 01:40:43 +00:00
|
|
|
#
|
2005-06-20 17:26:08 +00:00
|
|
|
# Copyright (C) 1999-2005, Digium
|
1999-12-05 01:40:43 +00:00
|
|
|
#
|
2005-06-20 17:26:08 +00:00
|
|
|
# Mark Spencer <markster@digium.com>
|
1999-12-05 01:40:43 +00:00
|
|
|
#
|
|
|
|
# This program is free software, distributed under the terms of
|
|
|
|
# the GNU General Public License
|
|
|
|
#
|
|
|
|
|
2005-11-01 21:53:30 +00:00
|
|
|
ifeq (${OSARCH},CYGWIN)
|
|
|
|
CYGSOLINK=-Wl,--out-implib=lib$@.a -Wl,--export-all-symbols
|
|
|
|
CYGSOLIB=-L.. -L. -lasterisk.dll
|
2005-11-08 04:13:19 +00:00
|
|
|
else
|
|
|
|
CFLAGS+=-fPIC
|
2005-11-01 21:53:30 +00:00
|
|
|
endif
|
|
|
|
|
2005-08-30 02:54:02 +00:00
|
|
|
ifneq ($(wildcard g723.1/coder.c),)
|
|
|
|
MODG723=codec_g723_1.so
|
|
|
|
LIBG723=g723.1/libg723.a
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(wildcard g723.1b/coder2.c),)
|
|
|
|
MODG723+=codec_g723_1b.so
|
|
|
|
LIBG723B=g723.1b/libg723b.a
|
|
|
|
endif
|
|
|
|
|
|
|
|
UI_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/speex.h)
|
|
|
|
UIS_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/speex/speex.h)
|
|
|
|
ULI_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/speex.h)
|
|
|
|
ULIS_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/speex/speex.h)
|
|
|
|
ifneq (${UI_SPEEX},)
|
|
|
|
MODSPEEX=codec_speex.so
|
|
|
|
LIBSPEEX+=-lspeex -lm
|
|
|
|
endif
|
|
|
|
ifneq (${UIS_SPEEX},)
|
|
|
|
MODSPEEX=codec_speex.so
|
2005-09-05 15:48:47 +00:00
|
|
|
CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/include/speex
|
2005-08-30 02:54:02 +00:00
|
|
|
LIBSPEEX+=-lspeex -lm
|
|
|
|
endif
|
|
|
|
ifneq (${ULI_SPEEX},)
|
|
|
|
MODSPEEX=codec_speex.so
|
2005-09-05 15:48:47 +00:00
|
|
|
CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include
|
2005-08-30 02:54:02 +00:00
|
|
|
LIBSPEEX=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
|
|
|
|
LIBSPEEX+=-lspeex -lm
|
|
|
|
endif
|
|
|
|
ifneq (${ULIS_SPEEX},)
|
|
|
|
MODSPEEX=codec_speex.so
|
2005-09-05 15:48:47 +00:00
|
|
|
CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/speex
|
2005-08-30 02:54:02 +00:00
|
|
|
LIBSPEEX=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
|
|
|
|
LIBSPEEX+=-lspeex -lm
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(wildcard ilbc/iLBC_decode.h),)
|
2005-08-31 21:29:58 +00:00
|
|
|
MODILBC=codec_ilbc.so
|
2005-08-30 02:54:02 +00:00
|
|
|
LIBILBC=ilbc/libilbc.a
|
|
|
|
endif
|
|
|
|
|
1999-12-05 01:40:43 +00:00
|
|
|
|
2005-12-20 08:16:53 +00:00
|
|
|
LIBGSM_PATH:=/usr/local/include /usr/include
|
|
|
|
LIBGSM_SYSTEM_HEADERS:=$(wildcard $(LIBGSM_PATH:%=$(CROSS_COMPILE_TARGET)%/gsm/gsm.h))
|
|
|
|
ifneq (,$(LIBGSM_SYSTEM_HEADERS))
|
|
|
|
LIBGSM=-lgsm
|
|
|
|
LIBGSMT=
|
|
|
|
CFLAGS+=-DUSE_EXTERNAL_GSM_LIB
|
|
|
|
else
|
1999-12-05 01:40:43 +00:00
|
|
|
LIBGSM=gsm/lib/libgsm.a
|
2005-12-20 08:16:53 +00:00
|
|
|
LIBGSMT=$(LIBGSM)
|
|
|
|
CFLAGS+=-I.
|
|
|
|
endif
|
|
|
|
|
2000-01-05 17:22:42 +00:00
|
|
|
LIBLPC10=lpc10/liblpc10.a
|
2005-08-30 02:54:02 +00:00
|
|
|
|
2004-07-02 23:11:14 +00:00
|
|
|
CODECS+=$(MODG723) $(MODSPEEX) $(MODILBC) codec_gsm.so codec_lpc10.so \
|
2004-02-25 04:10:32 +00:00
|
|
|
codec_adpcm.so codec_ulaw.so codec_alaw.so codec_a_mu.so \
|
|
|
|
codec_g726.so
|
1999-12-05 01:40:43 +00:00
|
|
|
|
2003-05-06 00:00:20 +00:00
|
|
|
all: depend $(CODECS)
|
1999-12-05 01:40:43 +00:00
|
|
|
|
|
|
|
clean:
|
2003-05-06 00:00:20 +00:00
|
|
|
rm -f *.so *.o .depend
|
2004-12-14 23:36:30 +00:00
|
|
|
[ ! -d g723.1 ] || $(MAKE) -C g723.1 clean
|
|
|
|
[ ! -d g723.1b ] || $(MAKE) -C g723.1b clean
|
2003-04-23 16:23:12 +00:00
|
|
|
$(MAKE) -C gsm clean
|
|
|
|
$(MAKE) -C lpc10 clean
|
|
|
|
$(MAKE) -C ilbc clean
|
1999-12-05 01:40:43 +00:00
|
|
|
|
|
|
|
$(LIBG723):
|
2003-04-23 16:23:12 +00:00
|
|
|
$(MAKE) -C g723.1 all
|
1999-12-05 01:40:43 +00:00
|
|
|
|
2005-08-30 02:54:02 +00:00
|
|
|
$(LIBGSM):
|
2003-04-23 16:23:12 +00:00
|
|
|
$(MAKE) -C gsm lib/libgsm.a
|
1999-12-05 01:40:43 +00:00
|
|
|
|
|
|
|
$(LIBG723B):
|
2003-04-23 16:23:12 +00:00
|
|
|
$(MAKE) -C g723.1b all
|
1999-12-05 01:40:43 +00:00
|
|
|
|
2000-01-05 17:22:42 +00:00
|
|
|
$(LIBLPC10):
|
2003-04-23 16:23:12 +00:00
|
|
|
$(MAKE) -C lpc10 all
|
2000-01-05 17:22:42 +00:00
|
|
|
|
2003-04-15 04:36:52 +00:00
|
|
|
$(LIBILBC):
|
2003-04-23 16:23:12 +00:00
|
|
|
$(MAKE) -C ilbc all
|
2003-04-15 04:36:52 +00:00
|
|
|
|
2005-08-30 02:54:02 +00:00
|
|
|
$(MODILBC): codec_ilbc.o $(LIBILBC)
|
2005-11-01 21:53:30 +00:00
|
|
|
$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(LIBILBC)
|
2003-04-15 04:36:52 +00:00
|
|
|
|
1999-12-05 01:40:43 +00:00
|
|
|
codec_g723_1.so : codec_g723_1.o $(LIBG723)
|
2005-11-01 21:53:30 +00:00
|
|
|
$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(LIBG723)
|
1999-12-05 01:40:43 +00:00
|
|
|
|
|
|
|
codec_g723_1b.o : codec_g723_1.c
|
2000-01-05 17:22:42 +00:00
|
|
|
$(CC) -c -o $@ $(CFLAGS) -DANNEX_B -Dsingle $<
|
1999-12-05 01:40:43 +00:00
|
|
|
|
|
|
|
codec_g723_1b.so : codec_g723_1b.o $(LIBG723B)
|
2005-11-01 21:53:30 +00:00
|
|
|
$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(LIBG723B) -lm
|
1999-12-05 01:40:43 +00:00
|
|
|
|
2002-06-21 01:40:13 +00:00
|
|
|
codec_gsm.so: codec_gsm.o $(LIBGSMT)
|
2005-11-01 21:53:30 +00:00
|
|
|
$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(LIBGSM)
|
1999-12-05 01:40:43 +00:00
|
|
|
|
2005-08-30 02:54:02 +00:00
|
|
|
$(MODSPEEX): codec_speex.o
|
2005-11-01 21:53:30 +00:00
|
|
|
$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(LIBSPEEX)
|
2002-08-29 04:53:56 +00:00
|
|
|
|
2000-01-05 17:22:42 +00:00
|
|
|
codec_lpc10.so: codec_lpc10.o $(LIBLPC10)
|
2005-11-01 21:53:30 +00:00
|
|
|
$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(LIBLPC10) -lm
|
2000-01-05 17:22:42 +00:00
|
|
|
|
1999-12-05 01:40:43 +00:00
|
|
|
%.so : %.o
|
2005-11-01 21:53:30 +00:00
|
|
|
$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB}
|
1999-12-05 01:40:43 +00:00
|
|
|
|
2004-07-19 15:52:57 +00:00
|
|
|
ifneq ($(wildcard .depend),)
|
2005-08-30 02:54:02 +00:00
|
|
|
include .depend
|
2004-07-19 15:52:57 +00:00
|
|
|
endif
|
2003-05-06 00:00:20 +00:00
|
|
|
|
1999-12-05 01:40:43 +00:00
|
|
|
install: all
|
2003-10-25 17:27:53 +00:00
|
|
|
for x in $(CODECS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
|
2003-05-06 00:00:20 +00:00
|
|
|
|
|
|
|
depend: .depend
|
|
|
|
|
|
|
|
.depend:
|
2005-06-20 17:26:08 +00:00
|
|
|
../build_tools/mkdep $(CFLAGS) `ls *.c`
|