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-06-05 20:46:27 +00:00
|
|
|
SELECTED_MODS:=$(filter-out $(MENUSELECT_CODECS),$(patsubst %.c,%,$(wildcard codec_*.c)))
|
2005-08-30 02:54:02 +00:00
|
|
|
|
2006-02-11 17:41:36 +00:00
|
|
|
ifeq ($(wildcard ilbc/iLBC_decode.h),)
|
2006-06-05 20:46:27 +00:00
|
|
|
MODS:=$(filter-out codec_ilbc,$(MODS))
|
2006-02-11 17:41:36 +00:00
|
|
|
else
|
2005-08-30 02:54:02 +00:00
|
|
|
LIBILBC=ilbc/libilbc.a
|
|
|
|
endif
|
|
|
|
|
2000-01-05 17:22:42 +00:00
|
|
|
LIBLPC10=lpc10/liblpc10.a
|
2005-08-30 02:54:02 +00:00
|
|
|
|
2006-06-05 20:46:27 +00:00
|
|
|
MODS:=$(patsubst %,%.so,$(SELECTED_MODS))
|
|
|
|
|
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):
|
2006-04-24 17:11:45 +00:00
|
|
|
CFLAGS="$(ASTCFLAGS)" $(MAKE) -C g723.1 all
|
1999-12-05 01:40:43 +00:00
|
|
|
|
2006-04-24 17:11:45 +00:00
|
|
|
gsm/lib/libgsm.a:
|
|
|
|
CFLAGS="$(ASTCFLAGS) -I." $(MAKE) -C gsm lib/libgsm.a
|
1999-12-05 01:40:43 +00:00
|
|
|
|
|
|
|
$(LIBG723B):
|
2006-04-24 17:11:45 +00:00
|
|
|
CFLAGS="$(ASTCFLAGS)" $(MAKE) -C g723.1b all
|
1999-12-05 01:40:43 +00:00
|
|
|
|
2000-01-05 17:22:42 +00:00
|
|
|
$(LIBLPC10):
|
2006-04-24 17:11:45 +00:00
|
|
|
CFLAGS="$(ASTCFLAGS)" $(MAKE) -C lpc10 all
|
2000-01-05 17:22:42 +00:00
|
|
|
|
2003-04-15 04:36:52 +00:00
|
|
|
$(LIBILBC):
|
2006-04-24 17:11:45 +00:00
|
|
|
CFLAGS="$(ASTCFLAGS)" $(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)
|
2006-04-24 17:11:45 +00:00
|
|
|
$(CC) $(SOLINK) -o $@ $< $(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)
|
2006-04-24 17:11:45 +00:00
|
|
|
$(CC) $(SOLINK) -o $@ $< $(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)
|
2006-04-24 17:11:45 +00:00
|
|
|
$(CC) $(SOLINK) -o $@ $< $(LIBG723B) -lm
|
|
|
|
|
|
|
|
ifeq ($(GSM_LIB),internal)
|
|
|
|
codec_gsm.o: codec_gsm.c
|
|
|
|
$(CC) -c -o $@ $(CFLAGS) -Igsm/inc $<
|
|
|
|
|
|
|
|
codec_gsm.so: codec_gsm.o gsm/lib/libgsm.a
|
|
|
|
$(CC) $(SOLINK) -o $@ $< gsm/lib/libgsm.a
|
|
|
|
else
|
|
|
|
codec_gsm.o: codec_gsm.c
|
|
|
|
$(CC) -c -o $@ $(CFLAGS) $(GSM_INCLUDE) $<
|
|
|
|
|
|
|
|
codec_gsm.so: codec_gsm.o
|
|
|
|
$(CC) $(SOLINK) -o $@ $< $(GSM_LIB)
|
|
|
|
endif
|
1999-12-05 01:40:43 +00:00
|
|
|
|
2006-04-24 17:11:45 +00:00
|
|
|
codec_speex.o: codec_speex.c
|
|
|
|
$(CC) -c -o $@ $(CFLAGS) $(SPEEX_INCLUDE) $<
|
1999-12-05 01:40:43 +00:00
|
|
|
|
2006-02-11 17:41:36 +00:00
|
|
|
codec_speex.so: codec_speex.o
|
2006-04-24 17:11:45 +00:00
|
|
|
$(CC) $(SOLINK) -o $@ $< $(SPEEX_LIB)
|
2002-08-29 04:53:56 +00:00
|
|
|
|
2000-01-05 17:22:42 +00:00
|
|
|
codec_lpc10.so: codec_lpc10.o $(LIBLPC10)
|
2006-04-24 17:11:45 +00:00
|
|
|
$(CC) $(SOLINK) -o $@ $< $(LIBLPC10) -lm
|
2000-01-05 17:22:42 +00:00
|
|
|
|
1999-12-05 01:40:43 +00:00
|
|
|
%.so : %.o
|
2006-04-24 17:11:45 +00:00
|
|
|
$(CC) $(SOLINK) -o $@ $<
|
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`
|