Makefile 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. #
  2. # Asterisk -- A telephony toolkit for Linux.
  3. #
  4. # Makefile for PBX applications
  5. #
  6. # Copyright (C) 1999-2005, Digium
  7. #
  8. # Mark Spencer <markster@digium.com>
  9. #
  10. # This program is free software, distributed under the terms of
  11. # the GNU General Public License
  12. #
  13. APPS=app_dial.so app_playback.so app_voicemail.so app_directory.so app_mp3.so\
  14. app_system.so app_echo.so app_record.so app_image.so app_url.so app_disa.so \
  15. app_adsiprog.so app_getcpeid.so app_milliwatt.so \
  16. app_zapateller.so app_setcallerid.so app_festival.so \
  17. app_queue.so app_senddtmf.so app_parkandannounce.so \
  18. app_setcidname.so app_lookupcidname.so app_macro.so \
  19. app_authenticate.so app_softhangup.so app_lookupblacklist.so \
  20. app_waitforring.so app_privacy.so app_db.so app_chanisavail.so \
  21. app_enumlookup.so app_transfer.so app_setcidnum.so app_cdr.so \
  22. app_hasnewvoicemail.so app_sayunixtime.so app_cut.so app_read.so \
  23. app_setcdruserfield.so app_random.so app_ices.so app_eval.so \
  24. app_nbscat.so app_sendtext.so app_exec.so \
  25. app_groupcount.so app_txtcidname.so app_controlplayback.so \
  26. app_talkdetect.so app_alarmreceiver.so app_userevent.so app_verbose.so \
  27. app_test.so app_forkcdr.so app_math.so app_realtime.so \
  28. app_dumpchan.so app_waitforsilence.so app_while.so app_setrdnis.so \
  29. app_md5.so app_readfile.so app_chanspy.so app_settransfercapability.so \
  30. app_dictate.so app_externalivr.so app_directed_pickup.so \
  31. app_mixmonitor.so app_stack.so
  32. #
  33. # Obsolete things...
  34. #
  35. #APPS+=app_sql_postgres.so
  36. #APPS+=app_sql_odbc.so
  37. #
  38. # Experimental things
  39. #
  40. #APPS+=app_ivrdemo.so
  41. #APPS+=app_skel.so
  42. #APPS+=app_rpt.so
  43. ifndef WITHOUT_ZAPTEL
  44. ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h),)
  45. APPS+=app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so app_page.so
  46. endif
  47. endif # WITHOUT_ZAPTEL
  48. ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/osp/osp.h $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
  49. APPS+=app_osplookup.so
  50. endif
  51. ifeq ($(findstring BSD,${OSARCH}),BSD)
  52. CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
  53. endif
  54. CURLLIBS=$(shell $(CROSS_COMPILE_BIN)curl-config --libs)
  55. ifneq ($(shell if [[ 0x`$(CROSS_COMPILE_BIN)curl-config --vernum` -ge 0x70907 ]]; then echo "OK" ; fi),)
  56. ifneq (${CURLLIBS},)
  57. APPS+=app_curl.so
  58. endif
  59. endif
  60. ifeq (${OSARCH},CYGWIN)
  61. CYGSOLINK=-Wl,--out-implib=lib$@.a -Wl,--export-all-symbols
  62. CYGSOLIB=-L.. -L. -L../res -lasterisk.dll -lres_features.so -lres_adsi.so -lres_monitor.so
  63. else
  64. CFLAGS+=-fPIC
  65. APPS+=app_sms.so
  66. endif
  67. #
  68. # If you have UnixODBC you can use ODBC voicemail
  69. # storage
  70. #
  71. # Uncomment to use ODBC storage
  72. #CFLAGS+=-DUSE_ODBC_STORAGE
  73. # Uncomment for extended ODBC voicemail storage
  74. #CFLAGS+=-DEXTENDED_ODBC_STORAGE
  75. # See doc/README.odbcstorage for more information
  76. all: $(APPS)
  77. clean:
  78. rm -f *.so *.o look .depend
  79. %.so : %.o
  80. $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB}
  81. app_rpt.so : app_rpt.o
  82. $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -ltonezone
  83. install: all
  84. for x in $(APPS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
  85. rm -f $(DESTDIR)$(MODULES_DIR)/app_datetime.so
  86. rm -f $(DESTDIR)$(MODULES_DIR)/app_qcall.so
  87. app_curl.so: app_curl.o
  88. $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(CURLLIBS)
  89. app_sql_postgres.o: app_sql_postgres.c
  90. $(CC) -pipe -I/usr/local/pgsql/include $(CFLAGS) -c -o app_sql_postgres.o app_sql_postgres.c
  91. app_sql_postgres.so: app_sql_postgres.o
  92. $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -L/usr/local/pgsql/lib -lpq
  93. app_sql_odbc.so: app_sql_odbc.o
  94. $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -lodbc
  95. look: look.c
  96. $(CC) -pipe -O6 -g look.c -o look -lncurses
  97. ifeq (SunOS,$(shell uname))
  98. app_chanspy.so: app_chanspy.o
  99. $(CC) $(SOLINK) -o $@ $< -lrt
  100. endif
  101. ifneq ($(wildcard .depend),)
  102. include .depend
  103. endif
  104. depend: .depend
  105. .depend:
  106. ../build_tools/mkdep $(CFLAGS) `ls *.c`
  107. env:
  108. env