Makefile 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #
  2. # Asterisk -- A telephony toolkit for Linux.
  3. #
  4. # Makefile for PBX frontends (dynamically loaded)
  5. #
  6. # Copyright (C) 1999, Mark Spencer
  7. #
  8. # Mark Spencer <markster@linux-support.net>
  9. #
  10. # This program is free software, distributed under the terms of
  11. # the GNU General Public License
  12. #
  13. #
  14. # Uncomment if you have g723.1 code (with the same API as the Annex-A code
  15. # and have placed it in the g723.1 directory and/or the Annex-B code in
  16. # g723.1b)
  17. #
  18. #MODG723=codec_g723_1.so codec_g723_1b.so
  19. MODG723=$(shell [ -f g723.1/coder.c ] && echo "codec_g723_1.so")
  20. MODG723+=$(shell [ -f g723.1b/coder2.c ] && echo "codec_g723_1b.so")
  21. MODSPEEX=$(shell [ -f /usr/include/speex.h ] || [ -f /usr/local/include/speex.h ] && echo "codec_speex.so")
  22. MODILBC=$(shell [ -f ilbc/iLBC_decode.h ] && echo "codec_ilbc.so")
  23. CFLAGS+=-fPIC
  24. CFLAGS+=$(shell [ -f /usr/local/include/speex.h ] && echo "-I/usr/local/include")
  25. LIBG723=g723.1/libg723.a
  26. LIBG723B=g723.1b/libg723b.a
  27. LIBGSM=gsm/lib/libgsm.a
  28. LIBGSMT=gsm/lib/libgsm.a
  29. LIBLPC10=lpc10/liblpc10.a
  30. LIBSPEEX=$(shell [ -f /usr/local/lib/libspeex.a ] && echo "-L/usr/local/lib")
  31. LIBSPEEX+=-lspeex -lm
  32. LIBILBC=ilbc/libilbc.a
  33. CODECS+=$(MODG723) $(MODSPEEX) $(MODILBC) codec_gsm.so codec_lpc10.so \
  34. codec_adpcm.so codec_ulaw.so codec_alaw.so codec_a_mu.so
  35. all: depend $(CODECS)
  36. clean:
  37. rm -f *.so *.o .depend
  38. ! [ -d g723.1 ] || $(MAKE) -C g723.1 clean
  39. ! [ -d g723.1b ] || $(MAKE) -C g723.1b clean
  40. $(MAKE) -C gsm clean
  41. $(MAKE) -C lpc10 clean
  42. $(MAKE) -C ilbc clean
  43. $(LIBG723):
  44. $(MAKE) -C g723.1 all
  45. gsm/lib/libgsm.a:
  46. $(MAKE) -C gsm lib/libgsm.a
  47. $(LIBG723B):
  48. $(MAKE) -C g723.1b all
  49. $(LIBLPC10):
  50. $(MAKE) -C lpc10 all
  51. $(LIBILBC):
  52. $(MAKE) -C ilbc all
  53. codec_ilbc.so: codec_ilbc.o $(LIBILBC)
  54. $(CC) $(SOLINK) -o $@ $< $(LIBILBC)
  55. codec_g723_1.so : codec_g723_1.o $(LIBG723)
  56. $(CC) $(SOLINK) -o $@ $< $(LIBG723)
  57. codec_g723_1b.o : codec_g723_1.c
  58. $(CC) -c -o $@ $(CFLAGS) -DANNEX_B -Dsingle $<
  59. codec_g723_1b.so : codec_g723_1b.o $(LIBG723B)
  60. $(CC) $(SOLINK) -o $@ $< $(LIBG723B) -lm
  61. codec_gsm.so: codec_gsm.o $(LIBGSMT)
  62. $(CC) $(SOLINK) -o $@ $< $(LIBGSM)
  63. codec_speex.so: codec_speex.o
  64. $(CC) $(SOLINK) -o $@ $< $(LIBSPEEX)
  65. codec_lpc10.so: codec_lpc10.o $(LIBLPC10)
  66. $(CC) $(SOLINK) -o $@ $< $(LIBLPC10) -lm
  67. %.so : %.o
  68. $(CC) $(SOLINK) -o $@ $<
  69. include .depend
  70. install: all
  71. for x in $(CODECS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
  72. depend: .depend
  73. .depend:
  74. ../mkdep $(CFLAGS) `ls *.c`