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
|
|
|
#
|
2006-02-11 17:41:36 +00:00
|
|
|
# Copyright (C) 1999-2006, Digium, Inc.
|
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
|
|
|
|
#
|
|
|
|
|
2006-02-11 17:41:36 +00:00
|
|
|
MODS:=$(patsubst %.c,%.so,$(wildcard codec_*.c))
|
|
|
|
|
2005-11-01 21:53:30 +00:00
|
|
|
ifeq (${OSARCH},CYGWIN)
|
2006-02-11 17:41:36 +00:00
|
|
|
CYGSOLINK=-Wl,--out-implib=lib$@.a -Wl,--export-all-symbols
|
|
|
|
CYGSOLIB=-L.. -L. -lasterisk.dll
|
2005-11-08 04:13:19 +00:00
|
|
|
else
|
2006-02-11 17:41:36 +00:00
|
|
|
CFLAGS+=-fPIC
|
2005-11-01 21:53:30 +00:00
|
|
|
endif
|
|
|
|
|
2006-02-11 17:41:36 +00:00
|
|
|
ifeq ($(wildcard g723.1/coder.c),)
|
|
|
|
MODS:=$(filter-out codec_g723_1.so,$(MODS))
|
|
|
|
else
|
2005-08-30 02:54:02 +00:00
|
|
|
LIBG723=g723.1/libg723.a
|
|
|
|
endif
|
|
|
|
|
2006-03-21 19:28:12 +00:00
|
|
|
ifneq ($(wildcard g723.1b/coder2.c),)
|
|
|
|
MODS+=codec_g723_1b.so
|
2005-08-30 02:54:02 +00:00
|
|
|
LIBG723B=g723.1b/libg723b.a
|
|
|
|
endif
|
|
|
|
|
2006-02-11 17:41:36 +00:00
|
|
|
SPEEX_PATH:=/usr/local/include /usr/include /usr/include/speex /usr/local/include/speex
|
2006-02-11 20:48:48 +00:00
|
|
|
SPEEX_SYSTEM_HEADERS:=$(firstword $(wildcard $(SPEEX_PATH:%=$(CROSS_COMPILE_TARGET)%/speex.h)))
|
2006-02-11 17:41:36 +00:00
|
|
|
ifeq (${SPEEX_SYSTEM_HEADERS},)
|
|
|
|
MODS:=$(filter-out codec_speex.so,$(MODS))
|
|
|
|
else
|
|
|
|
CFLAGS+=-I$(subst /speex.h,,${SPEEX_SYSTEM_HEADERS})
|
|
|
|
LIBSPEEX=-lspeex -lm
|
2005-08-30 02:54:02 +00:00
|
|
|
endif
|
|
|
|
|
2006-02-11 17:41:36 +00:00
|
|
|
ifeq ($(wildcard ilbc/iLBC_decode.h),)
|
|
|
|
MODS:=$(filter-out codec_ilbc.so,$(MODS))
|
|
|
|
else
|
2005-08-30 02:54:02 +00:00
|
|
|
LIBILBC=ilbc/libilbc.a
|
|
|
|
endif
|
|
|
|
|
2005-12-20 08:16:53 +00:00
|
|
|
LIBGSM_PATH:=/usr/local/include /usr/include
|
2006-02-11 20:48:48 +00:00
|
|
|
LIBGSM_SYSTEM_HEADERS:=$(firstword $(wildcard $(LIBGSM_PATH:%=$(CROSS_COMPILE_TARGET)%/gsm/gsm.h)))
|
2006-02-11 17:41:36 +00:00
|
|
|
ifneq ($(LIBGSM_SYSTEM_HEADERS),)
|
|
|
|
LIBGSM=-lgsm
|
|
|
|
LIBGSMT=
|
|
|
|
CFLAGS+=-DUSE_EXTERNAL_GSM_LIB
|
2005-12-20 08:16:53 +00:00
|
|
|
else
|
2006-02-11 17:41:36 +00:00
|
|
|
LIBGSM=gsm/lib/libgsm.a
|
|
|
|
LIBGSMT=$(LIBGSM)
|
|
|
|
CFLAGS+=-I.
|
2005-12-20 08:16:53 +00:00
|
|
|
endif
|
|
|
|
|
2000-01-05 17:22:42 +00:00
|
|
|
LIBLPC10=lpc10/liblpc10.a
|
2005-08-30 02:54:02 +00:00
|
|
|
|
2006-02-11 17:41:36 +00:00
|
|
|
all: depend $(MODS)
|
1999-12-05 01:40:43 +00:00
|
|
|
|
2006-02-12 16:52:42 +00:00
|
|
|
clean-depend:
|
|
|
|
rm -f .depend
|
|
|
|
|
|
|
|
clean: clean-depend
|
|
|
|
rm -f *.so *.o
|
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
|
|
|
|
2006-02-13 01:58:33 +00:00
|
|
|
codec_ilbc.so: 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
|
|
|
|
2006-02-11 17:41:36 +00:00
|
|
|
codec_speex.so: 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
|
2006-02-11 17:41:36 +00:00
|
|
|
for x in $(MODS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
|
2003-05-06 00:00:20 +00:00
|
|
|
|
2006-02-01 18:39:41 +00:00
|
|
|
uninstall:
|
|
|
|
|
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`
|