Makefile.am 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833
  1. EXTRA_DIST =
  2. SUBDIRS = . src build tests/unit
  3. AUTOMAKE_OPTIONS = foreign subdir-objects
  4. NAME = freeswitch
  5. if SYSTEM_APR
  6. AM_LIBAPR_CFLAGS := $(shell apr-1-config --cflags)
  7. AM_LIBAPR_CPPFLAGS := $(shell apr-1-config --cppflags --includes)
  8. AM_LIBAPR_LDFLAGS := $(shell apr-1-config --ldflags)
  9. AM_LIBAPR_LIBS := $(shell apr-1-config \--libs)
  10. AM_LIBAPR_LINKLIBTOOL := $(shell apr-1-config \--link-libtool)
  11. else
  12. AM_LIBAPR_CFLAGS := $(shell ./libs/apr/apr-1-config --cflags)
  13. AM_LIBAPR_CPPFLAGS := $(shell ./libs/apr/apr-1-config --cppflags --includes)
  14. AM_LIBAPR_LDFLAGS := $(shell ./libs/apr/apr-1-config --ldflags)
  15. AM_LIBAPR_LIBS := $(subst $(switch_builddir)/,,$(shell ./libs/apr/apr-1-config \--libs))
  16. endif
  17. AM_CFLAGS = $(SWITCH_AM_CFLAGS) $(SWITCH_ANSI_CFLAGS)
  18. AM_CPPFLAGS =
  19. AM_CPPFLAGS += -I$(switch_srcdir)/libs/libvpx
  20. AM_CPPFLAGS += $(SWITCH_AM_CXXFLAGS)
  21. AM_LDFLAGS = $(SWITCH_AM_LDFLAGS) $(AM_LIBAPR_LDFLAGS) $(AM_LIBAPU_LDFLAGS)
  22. DEFAULT_SOUNDS=en-us-callie-8000
  23. MY_DEFAULT_ARGS= --build=$(build) --host=$(host) --target=$(target) --prefix="$(prefix)" --exec_prefix="$(exec_prefix)" --libdir="$(libdir)"
  24. .INTERMEDIATE: -ldl -liconv -lpthread
  25. .DEFAULT: $(switch_builddir)/modules.conf src/mod/modules.inc
  26. @target=`echo $@ | sed -e 's|^.*-||'`; \
  27. target_prefix=`echo $@ | sed -e 's|-.*$$||'`; \
  28. sound_perfix=`echo $@ | sed -e 's|-.*||'`; \
  29. moh_version=`cat $(switch_srcdir)/build/moh_version.txt`;\
  30. full_sound_dir=`echo $@ | sed -e 's|^sounds||' | sed -e 's|^-||' | sed -e 's|-install$$||'`; \
  31. test ! -z $$full_sound_dir || full_sound_dir=`echo $(DEFAULT_SOUNDS)`; \
  32. base_sound_dir=`echo $$full_sound_dir | sed -e 's|-[^-]*000$$||' ` ;\
  33. sounds_version=`grep $$base_sound_dir $(switch_srcdir)/build/sounds_version.txt | cut -d ' ' -f2`;\
  34. soundfile=`echo freeswitch-sounds-$$full_sound_dir-$$moh_version.tar.gz`; \
  35. echo $$full_sound_dir | grep music >/dev/null || soundfile=`echo freeswitch-sounds-$$full_sound_dir-$$sounds_version.tar.gz`; \
  36. args="$@"; if test -z "$$args" || test "$${args#-l*}" = "$$args"; then \
  37. if test "$$target_prefix" = "sounds"; then \
  38. if test "$$target" = "install"; then \
  39. $(GETSOUNDS) $$soundfile $(DESTDIR)$(soundsdir)/;\
  40. else \
  41. $(GETSOUNDS) $$soundfile ; \
  42. fi; \
  43. else \
  44. if test "$$target" = "install"; then \
  45. $(MAKE) $(AM_MAKEFLAGS) core_install && cd src/mod && $(MAKE) $(AM_MAKEFLAGS) $@ ; \
  46. else \
  47. if test "$$target" = "clean"; then \
  48. cd src/mod && $(MAKE) $(AM_MAKEFLAGS) $@ ;\
  49. else \
  50. $(MAKE) $(AM_MAKEFLAGS) core && cd src/mod && $(MAKE) $(AM_MAKEFLAGS) $@ ;\
  51. fi; \
  52. fi; \
  53. fi; fi
  54. sounds: sounds-en-us-callie-8000
  55. sounds-install: sounds-en-us-callie-8000-install
  56. sounds-allison: sounds-en-us-allison-8000
  57. sounds-allison-install: sounds-en-us-allison-8000-install
  58. sounds-ru: sounds-ru-RU-elena-8000
  59. sounds-ru-install: sounds-ru-RU-elena-8000-install
  60. sounds-fr: sounds-fr-ca-june-8000
  61. sounds-fr-install: sounds-fr-ca-june-8000-install
  62. moh: sounds-music-8000
  63. moh-install: sounds-music-8000-install
  64. hd-sounds: sounds sounds-en-us-callie-16000
  65. hd-sounds-install: sounds-install sounds-en-us-callie-16000-install
  66. hd-sounds-allison: sounds-allison sounds-en-us-allison-16000
  67. hd-sounds-allison-install: sounds-allison-install sounds-en-us-allison-16000-install
  68. hd-sounds-ru: sounds-ru sounds-ru-RU-elena-16000
  69. hd-sounds-ru-install: sounds-ru-install sounds-ru-RU-elena-16000-install
  70. hd-sounds-fr: sounds-fr-ca-june-16000
  71. hd-sounds-fr-install: sounds-fr-ca-june-16000-install
  72. hd-moh: moh sounds-music-16000
  73. hd-moh-install: moh-install sounds-music-16000-install
  74. uhd-sounds: hd-sounds sounds-en-us-callie-32000
  75. uhd-sounds-install: hd-sounds-install sounds-en-us-callie-32000-install
  76. uhd-sounds-allison: hd-sounds-allison sounds-en-us-allison-32000
  77. uhd-sounds-allison-install: hd-sounds-allison-install sounds-en-us-allison-32000-install
  78. uhd-sounds-ru: hd-sounds-ru sounds-ru-RU-elena-32000
  79. uhd-sounds-ru-install: hd-sounds-ru-install sounds-ru-RU-elena-32000-install
  80. uhd-sounds-fr: sounds-fr-ca-june-32000
  81. uhd-sounds-fr-install: sounds-fr-ca-june-32000-install
  82. uhd-moh: hd-moh sounds-music-32000
  83. uhd-moh-install: hd-moh-install sounds-music-32000-install
  84. cd-sounds: uhd-sounds sounds-en-us-callie-48000
  85. cd-sounds-install: uhd-sounds-install sounds-en-us-callie-48000-install
  86. cd-sounds-allison: uhd-sounds-allison sounds-en-us-allison-48000
  87. cd-sounds-allison-install: uhd-sounds-allison-install sounds-en-us-allison-48000-install
  88. cd-sounds-ru: uhd-sounds-ru sounds-ru-RU-elena-48000
  89. cd-sounds-ru-install: uhd-sounds-ru-install sounds-ru-RU-elena-48000-install
  90. cd-sounds-fr: sounds-fr-ca-june-48000
  91. cd-sounds-fr-install: sounds-fr-ca-june-48000-install
  92. cd-moh: uhd-moh sounds-music-48000
  93. cd-moh-install: uhd-moh-install sounds-music-48000-install
  94. # This directory's subdirectories are mostly independent; you can cd
  95. # into them and run `make' without going through this Makefile.
  96. # To change the values of `make' variables: instead of editing Makefiles,
  97. # (1) if the variable is set in `config.status', edit `config.status'
  98. # (which will cause the Makefiles to be regenerated when you run `make');
  99. # (2) otherwise, pass the desired values on the `make' command line.
  100. all-recursive: libfreeswitch.la
  101. clean-recusive: clean_core
  102. install-recursive: install-libLTLIBRARIES install-binPROGRAMS
  103. CORE_CFLAGS = $(AM_LIBAPR_CFLAGS) $(AM_LIBAPR_CPPFLAGS)
  104. CORE_CFLAGS += $(AM_LIBAPU_CPPFLAGS)
  105. CORE_CFLAGS += -I$(switch_srcdir)/libs/srtp/include
  106. if ENABLE_LIBYUV
  107. CORE_CFLAGS += -I$(switch_srcdir)/libs/libyuv/include
  108. CORE_CFLAGS += -DSWITCH_HAVE_YUV
  109. endif
  110. CORE_CFLAGS += -I$(switch_srcdir)/libs/srtp/crypto/include -Ilibs/srtp/crypto/include
  111. CORE_CFLAGS += $(SPANDSP_CFLAGS)
  112. if ENABLE_LIBVPX
  113. CORE_CFLAGS += -DSWITCH_HAVE_VPX
  114. endif
  115. APR_LIBS = $(AM_LIBAPU_LIBS) $(AM_LIBAPR_LIBS)
  116. CORE_LIBS=
  117. if ENABLE_LIBVPX
  118. CORE_LIBS += libs/libvpx/libvpx.a
  119. endif
  120. if SYSTEM_APR
  121. CORE_LIBS += $(AM_LIBAPR_LINKLIBTOOL)
  122. else
  123. CORE_LIBS += libs/apr/libapr-1.la
  124. endif
  125. if ENABLE_SRTP
  126. CORE_CFLAGS += -DENABLE_SRTP
  127. CORE_LIBS += libs/srtp/libsrtp.la
  128. endif
  129. MOD_LINK = $(switch_srcdir)/libfreeswitch.la
  130. CLEANFILES = src/include/switch_version.h src/include/switch_swigable_cpp.h
  131. BUILT_SOURCES = src/mod/modules.inc src/include/switch_version.h src/include/switch_swigable_cpp.h
  132. if HAVE_ODBC
  133. CORE_CFLAGS += -DSWITCH_HAVE_ODBC $(ODBC_INC_FLAGS)
  134. endif
  135. if HAVE_PNG
  136. CORE_CFLAGS += -DSWITCH_HAVE_PNG $(LIBPNG_CFLAGS)
  137. endif
  138. if HAVE_FREETYPE
  139. CORE_CFLAGS += -DSWITCH_HAVE_FREETYPE $(LIBFREETYPE_CFLAGS)
  140. endif
  141. if HAVE_GUMBO
  142. CORE_CFLAGS += -DSWITCH_HAVE_GUMBO $(LIBGUMBO_CFLAGS)
  143. endif
  144. if HAVE_FVAD
  145. CORE_CFLAGS += -DSWITCH_HAVE_FVAD $(LIBFVAD_CFLAGS)
  146. endif
  147. ##
  148. ## libfreeswitch
  149. ##
  150. noinst_LTLIBRARIES =
  151. if ENABLE_LIBYUV
  152. noinst_LTLIBRARIES += libfreeswitch_libyuv.la
  153. endif
  154. if ENABLE_LIBYUV
  155. libfreeswitch_libyuv_la_SOURCES = \
  156. libs/libyuv/source/compare.cc \
  157. libs/libyuv/source/compare_common.cc \
  158. libs/libyuv/source/compare_gcc.cc \
  159. libs/libyuv/source/compare_mmi.cc \
  160. libs/libyuv/source/compare_msa.cc \
  161. libs/libyuv/source/compare_neon64.cc \
  162. libs/libyuv/source/compare_neon.cc \
  163. libs/libyuv/source/compare_win.cc \
  164. libs/libyuv/source/convert_argb.cc \
  165. libs/libyuv/source/convert.cc \
  166. libs/libyuv/source/convert_from_argb.cc \
  167. libs/libyuv/source/convert_from.cc \
  168. libs/libyuv/source/convert_jpeg.cc \
  169. libs/libyuv/source/convert_to_argb.cc \
  170. libs/libyuv/source/convert_to_i420.cc \
  171. libs/libyuv/source/cpu_id.cc \
  172. libs/libyuv/source/mjpeg_decoder.cc \
  173. libs/libyuv/source/mjpeg_validate.cc \
  174. libs/libyuv/source/planar_functions.cc \
  175. libs/libyuv/source/rotate_any.cc \
  176. libs/libyuv/source/rotate_argb.cc \
  177. libs/libyuv/source/rotate.cc \
  178. libs/libyuv/source/rotate_common.cc \
  179. libs/libyuv/source/rotate_gcc.cc \
  180. libs/libyuv/source/rotate_mmi.cc \
  181. libs/libyuv/source/rotate_msa.cc \
  182. libs/libyuv/source/rotate_neon64.cc \
  183. libs/libyuv/source/rotate_neon.cc \
  184. libs/libyuv/source/rotate_win.cc \
  185. libs/libyuv/source/row_any.cc \
  186. libs/libyuv/source/row_common.cc \
  187. libs/libyuv/source/row_gcc.cc \
  188. libs/libyuv/source/row_mmi.cc \
  189. libs/libyuv/source/row_msa.cc \
  190. libs/libyuv/source/row_neon64.cc \
  191. libs/libyuv/source/row_neon.cc \
  192. libs/libyuv/source/row_win.cc \
  193. libs/libyuv/source/scale_any.cc \
  194. libs/libyuv/source/scale_argb.cc \
  195. libs/libyuv/source/scale.cc \
  196. libs/libyuv/source/scale_common.cc \
  197. libs/libyuv/source/scale_gcc.cc \
  198. libs/libyuv/source/scale_mmi.cc \
  199. libs/libyuv/source/scale_msa.cc \
  200. libs/libyuv/source/scale_neon64.cc \
  201. libs/libyuv/source/scale_neon.cc \
  202. libs/libyuv/source/scale_win.cc \
  203. libs/libyuv/source/video_common.cc
  204. libfreeswitch_libyuv_la_CPPFLAGS = -O2 -fomit-frame-pointer -Ilibs/libyuv/include
  205. CORE_LIBS+=libfreeswitch_libyuv.la
  206. endif
  207. lib_LTLIBRARIES = libfreeswitch.la
  208. libfreeswitch_la_CFLAGS = $(CORE_CFLAGS) $(SQLITE_CFLAGS) $(GUMBO_CFLAGS) $(FVAD_CFLAGS) $(FREETYPE_CFLAGS) $(CURL_CFLAGS) $(PCRE_CFLAGS) $(SPEEX_CFLAGS) $(LIBEDIT_CFLAGS) $(openssl_CFLAGS) $(SOFIA_SIP_CFLAGS) $(AM_CFLAGS) $(TPL_CFLAGS)
  209. libfreeswitch_la_LDFLAGS = -version-info 1:0:0 $(AM_LDFLAGS) $(PLATFORM_CORE_LDFLAGS) -no-undefined
  210. libfreeswitch_la_LIBADD = $(CORE_LIBS) $(APR_LIBS) $(SQLITE_LIBS) $(GUMBO_LIBS) $(FVAD_LIBS) $(FREETYPE_LIBS) $(CURL_LIBS) $(PCRE_LIBS) $(SPEEX_LIBS) $(LIBEDIT_LIBS) $(SYSTEMD_LIBS) $(openssl_LIBS) $(PLATFORM_CORE_LIBS) $(TPL_LIBS) $(SPANDSP_LIBS) $(SOFIA_SIP_LIBS)
  211. libfreeswitch_la_DEPENDENCIES = $(BUILT_SOURCES)
  212. if HAVE_PNG
  213. libfreeswitch_la_LIBADD += $(LIBPNG_LIBS)
  214. endif
  215. if HAVE_ODBC
  216. libfreeswitch_la_LDFLAGS += $(ODBC_LIB_FLAGS)
  217. endif
  218. library_includetestdir = $(includedir)/test
  219. library_includetest_HEADERS = \
  220. src/include/test/switch_fct.h \
  221. src/include/test/switch_test.h
  222. library_includedir = $(includedir)
  223. library_include_HEADERS = \
  224. src/include/switch_am_config.h \
  225. src/include/switch.h \
  226. src/include/switch_apr.h \
  227. src/include/switch_buffer.h \
  228. src/include/switch_caller.h \
  229. src/include/switch_channel.h \
  230. src/include/switch_console.h \
  231. src/include/switch_core_event_hook.h \
  232. src/include/switch_scheduler.h \
  233. src/include/switch_core.h \
  234. src/include/switch_core_media.h \
  235. src/include/switch_core_video.h \
  236. src/include/switch_core_db.h \
  237. src/include/switch_mprintf.h \
  238. src/include/switch_config.h \
  239. src/include/switch_event.h \
  240. src/include/switch_frame.h \
  241. src/include/switch_ivr.h \
  242. src/include/switch_dso.h \
  243. src/include/switch_loadable_module.h \
  244. src/include/switch_module_interfaces.h \
  245. src/include/switch_packetizer.h \
  246. src/include/switch_platform.h \
  247. src/include/switch_resample.h \
  248. src/include/switch_regex.h \
  249. src/include/switch_types.h \
  250. src/include/switch_utils.h \
  251. src/include/switch_rtp.h \
  252. src/include/switch_jitterbuffer.h \
  253. src/include/switch_estimators.h \
  254. src/include/switch_rtcp_frame.h \
  255. src/include/switch_spandsp.h \
  256. src/include/switch_stun.h \
  257. src/include/switch_nat.h \
  258. src/include/switch_log.h \
  259. src/include/switch_xml.h \
  260. src/include/switch_xml_config.h \
  261. src/include/switch_cpp.h \
  262. src/include/switch_curl.h \
  263. src/include/switch_cJSON.h \
  264. src/include/switch_cJSON_Utils.h \
  265. src/include/switch_json.h \
  266. src/include/switch_utf8.h \
  267. src/include/switch_msrp.h \
  268. src/include/switch_vpx.h \
  269. src/include/switch_vad.h \
  270. src/include/xswitch.h \
  271. libs/libteletone/src/libteletone_detect.h \
  272. libs/libteletone/src/libteletone_generate.h \
  273. libs/libteletone/src/libteletone.h \
  274. src/include/switch_limit.h \
  275. src/include/switch_odbc.h \
  276. src/include/switch_hashtable.h \
  277. src/include/switch_image.h
  278. nodist_libfreeswitch_la_SOURCES = \
  279. src/include/switch_frame.h \
  280. src/include/switch_swigable_cpp.h \
  281. src/include/switch_version.h
  282. libfreeswitch_la_SOURCES = \
  283. src/switch_apr.c \
  284. src/switch_apr_queue.c \
  285. src/switch_buffer.c \
  286. src/switch_caller.c \
  287. src/switch_channel.c \
  288. src/switch_console.c \
  289. src/switch_mprintf.c \
  290. src/switch_core_media_bug.c \
  291. src/switch_core_timer.c \
  292. src/switch_core_asr.c \
  293. src/switch_core_event_hook.c \
  294. src/switch_core_speech.c \
  295. src/switch_core_memory.c \
  296. src/switch_core_codec.c \
  297. src/switch_core_file.c \
  298. src/switch_core_cert.c \
  299. src/switch_core_hash.c \
  300. src/switch_core_sqldb.c \
  301. src/switch_core_session.c \
  302. src/switch_core_directory.c \
  303. src/switch_core_state_machine.c \
  304. src/switch_core_io.c \
  305. src/switch_core_rwlock.c \
  306. src/switch_core_port_allocator.c \
  307. src/switch_core.c \
  308. src/switch_version.c \
  309. src/switch_core_media.c \
  310. src/switch_core_video.c \
  311. src/switch_packetizer.c \
  312. src/switch_sdp.c \
  313. src/switch_scheduler.c \
  314. src/switch_core_db.c \
  315. src/switch_dso.c \
  316. src/switch_loadable_module.c \
  317. src/switch_utils.c \
  318. src/switch_event.c \
  319. src/switch_resample.c \
  320. src/switch_regex.c \
  321. src/switch_rtp.c \
  322. src/switch_jitterbuffer.c \
  323. src/switch_estimators.c \
  324. src/switch_ivr_bridge.c \
  325. src/switch_ivr_originate.c \
  326. src/switch_ivr_async.c \
  327. src/switch_ivr_play_say.c \
  328. src/switch_ivr_say.c \
  329. src/switch_ivr_menu.c \
  330. src/switch_ivr.c \
  331. src/switch_spandsp.c \
  332. src/switch_stun.c \
  333. src/switch_nat.c \
  334. src/switch_log.c \
  335. src/switch_xml.c \
  336. src/switch_xml_config.c \
  337. src/switch_config.c \
  338. src/switch_time.c \
  339. src/switch_odbc.c \
  340. src/switch_limit.c \
  341. src/g711.c \
  342. src/switch_pcm.c \
  343. src/switch_speex.c \
  344. src/switch_profile.c \
  345. src/cJSON.c \
  346. src/cJSON_Utils.c \
  347. src/switch_json.c \
  348. src/switch_curl.c \
  349. src/switch_hashtable.c\
  350. src/switch_utf8.c \
  351. src/switch_msrp.c \
  352. src/switch_vad.c \
  353. src/switch_vpx.c \
  354. src/xswitch.c \
  355. libs/libteletone/src/libteletone_detect.c \
  356. libs/libteletone/src/libteletone_generate.c \
  357. libs/miniupnpc/miniwget.c \
  358. libs/miniupnpc/minixml.c \
  359. libs/miniupnpc/igd_desc_parse.c \
  360. libs/miniupnpc/minisoap.c \
  361. libs/miniupnpc/miniupnpc.c \
  362. libs/miniupnpc/upnpreplyparse.c \
  363. libs/miniupnpc/upnpcommands.c \
  364. libs/miniupnpc/minissdpc.c \
  365. libs/miniupnpc/upnperrors.c \
  366. libs/libnatpmp/natpmp.c \
  367. libs/libnatpmp/getgateway.c
  368. if ENABLE_CPP
  369. libfreeswitch_la_SOURCES += src/switch_cpp.cpp
  370. endif
  371. $(libfreeswitch_la_SOURCES): $(CORE_LIBS) $(switch_builddir)/modules.conf
  372. src/include/switch_swigable_cpp.h: $(switch_srcdir)/src/include/switch_cpp.h
  373. cat $(switch_srcdir)/src/include/switch_cpp.h | perl $(switch_srcdir)/build/strip.pl > $(switch_srcdir)/src/include/switch_swigable_cpp.h
  374. # $(CC) -E $(switch_srcdir)/src/include/switch_cpp.h \
  375. # -I$(switch_srcdir)/src/include -I$(switch_srcdir)/libs/libteletone/src \
  376. # -DSWITCH_DECLARE_CLASS= -DSWITCH_DECLARE\(x\)=x -DSWITCH_DECLARE_CONSTRUCTOR= \
  377. # -DSWITCH_DECLARE_NONSTD\(x\)=x 2>/dev/null | grep -v "^#" > src/include/switch_swigable_cpp.h
  378. ##
  379. ## Applications
  380. ##
  381. bin_PROGRAMS = freeswitch fs_cli fs_ivrd tone2wav fs_encode fs_tts
  382. ##
  383. ## fs_cli ()
  384. ##
  385. fs_cli_SOURCES = libs/esl/src/esl.c libs/esl/src/esl_config.c libs/esl/src/esl_event.c \
  386. libs/esl/src/esl_threadmutex.c libs/esl/fs_cli.c libs/esl/src/esl_json.c libs/esl/src/esl_buffer.c libs/esl/src/cJSON.c libs/esl/src/cJSON_Utils.c
  387. fs_cli_CFLAGS = $(AM_CFLAGS) -I$(switch_srcdir)/libs/esl/src/include $(LIBEDIT_CFLAGS)
  388. fs_cli_LDFLAGS = $(AM_LDFLAGS) -lpthread $(ESL_LDFLAGS) -lm $(LIBEDIT_LIBS)
  389. if DISABLE_CC
  390. fs_cli_CFLAGS += -DDISABLE_CC
  391. endif
  392. ##
  393. ## fs_encode ()
  394. ##
  395. fs_encode_SOURCES = src/fs_encode.c
  396. fs_encode_CFLAGS = $(AM_CFLAGS)
  397. fs_encode_LDFLAGS = $(AM_LDFLAGS)
  398. fs_encode_LDADD = libfreeswitch.la $(CORE_LIBS) $(APR_LIBS)
  399. if HAVE_ODBC
  400. fs_encode_LDADD += $(ODBC_LIB_FLAGS)
  401. endif
  402. ##
  403. ## fs_tts ()
  404. ##
  405. fs_tts_SOURCES = src/fs_tts.c
  406. fs_tts_CFLAGS = $(AM_CFLAGS)
  407. fs_tts_LDFLAGS = $(AM_LDFLAGS)
  408. fs_tts_LDADD = libfreeswitch.la $(CORE_LIBS) $(APR_LIBS)
  409. ##
  410. ## tone2wav ()
  411. ##
  412. tone2wav_SOURCES = src/tone2wav.c
  413. tone2wav_CFLAGS = $(AM_CFLAGS)
  414. tone2wav_LDFLAGS = $(AM_LDFLAGS)
  415. tone2wav_LDADD = libfreeswitch.la $(CORE_LIBS) $(APR_LIBS)
  416. if HAVE_ODBC
  417. tone2wav_LDADD += $(ODBC_LIB_FLAGS)
  418. endif
  419. ##
  420. ## fs_ivrd ()
  421. ##
  422. fs_ivrd_SOURCES = libs/esl/src/esl.c libs/esl/src/esl_config.c libs/esl/src/esl_event.c \
  423. libs/esl/src/esl_threadmutex.c libs/esl/ivrd.c libs/esl/src/esl_json.c libs/esl/src/esl_buffer.c libs/esl/src/cJSON.c libs/esl/src/cJSON_Utils.c
  424. fs_ivrd_CFLAGS = $(AM_CFLAGS) -I$(switch_srcdir)/libs/esl/src/include
  425. fs_ivrd_LDFLAGS = $(AM_LDFLAGS) -lpthread $(ESL_LDFLAGS) -lm
  426. ##
  427. ## freeswitch ()
  428. ##
  429. nodist_freeswitch_SOURCES = src/include/switch_version.h
  430. freeswitch_SOURCES = src/switch.c
  431. freeswitch_CFLAGS = $(AM_CFLAGS) $(CORE_CFLAGS)
  432. freeswitch_LDFLAGS = $(AM_LDFLAGS) -lpthread -rpath $(libdir)
  433. freeswitch_LDADD = libfreeswitch.la libs/apr/libapr-1.la
  434. if HAVE_ODBC
  435. freeswitch_LDADD += $(ODBC_LIB_FLAGS)
  436. endif
  437. ##
  438. ## Scripts
  439. ##
  440. bin_SCRIPTS = scripts/gentls_cert scripts/fsxs
  441. scripts/fsxs: scripts/fsxs.in
  442. @echo creating fsxs
  443. @sed -e "s,@MODULES_DIR\@,@modulesdir@," \
  444. -e "s,@LIB_DIR\@,@libdir@," \
  445. -e "s,@BIN_DIR\@,@bindir@," \
  446. -e "s,@INC_DIR\@,@includedir@," \
  447. -e "s,@CFG_DIR\@,@confdir@," \
  448. -e "s,@DB_DIR\@,@dbdir@," \
  449. -e "s,@PREFIX\@,@prefix@," \
  450. -e "s,@CC\@,$(CC)," \
  451. -e "s,@LD\@,$(CC)," \
  452. -e "s,@INSTALL\@,$(INSTALL)," \
  453. -e "s,@MKINSTALLDIRS\@,$(mkdir_p)," \
  454. \
  455. -e "s|@CFLAGS\@|$(CFLAGS) `./libs/apr/apr-1-config --cflags --cppflags`|" \
  456. -e "s|@INCLUDES\@|-I$(prefix)/include|" \
  457. -e "s|@SOLINK\@|$(SOLINK)|" \
  458. -e "s|@LDFLAGS\@|-L$(prefix)/lib|" \
  459. -e "s|@LIBS\@||" \
  460. $(top_srcdir)/scripts/fsxs.in > scripts/fsxs
  461. ##
  462. ## misc
  463. ##
  464. pkgconfigdir = @pkgconfigdir@
  465. pkgconfig_DATA = build/freeswitch.pc
  466. $(switch_builddir)/modules.conf:
  467. if test -f $@; then touch $@; else cp $(switch_srcdir)/build/modules.conf.in $@ ;fi
  468. src/mod/modules.inc: $(switch_builddir)/modules.conf
  469. @echo "OUR_MODULES=$(OUR_MODS)" > $(switch_builddir)/src/mod/modules.inc
  470. @echo "OUR_CLEAN_MODULES=$(OUR_CLEAN_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  471. @echo "OUR_TEST_MODULES=$(OUR_TEST_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  472. @echo "OUR_CHECK_MODULES=$(OUR_CHECK_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  473. @echo "OUR_INSTALL_MODULES=$(OUR_INSTALL_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  474. @echo "OUR_UNINSTALL_MODULES=$(OUR_UNINSTALL_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  475. @echo "OUR_DISABLED_MODULES=$(OUR_DISABLED_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  476. @echo "OUR_DISABLED_CLEAN_MODULES=$(OUR_DISABLED_CLEAN_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  477. @echo "OUR_DISABLED_INSTALL_MODULES=$(OUR_DISABLED_INSTALL_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  478. @echo "OUR_DISABLED_UNINSTALL_MODULES=$(OUR_DISABLED_UNINSTALL_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  479. $(OUR_MODULES): $(switch_builddir)/modules.conf libfreeswitch.la src/mod/modules.inc
  480. @set fnord $$MAKEFLAGS; amf=$$2; \
  481. (cd src/mod && $(MAKE) $(AM_MAKEFLAGS) $@) \
  482. || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
  483. test -z "$$fail"
  484. $(switch_builddir)/build/print_git_revision: $(switch_srcdir)/build/print_git_revision.c
  485. $(CC_FOR_BUILD) -o $@ $<
  486. src/switch_version.lo: src/include/switch_version.h
  487. src/include/switch_version.h: src/include/switch_version.h.in Makefile $(switch_builddir)/build/print_git_revision $(libfreeswitch_la_SOURCES) $(library_include_HEADERS)
  488. @cat $< > $@; \
  489. if [ -d $(switch_srcdir)/.git ] && [ -n "$$(which git)" ]; then \
  490. xver="$$(cd $(switch_srcdir)/ && $(switch_builddir)/build/print_git_revision)"; \
  491. xhver="$$(cd $(switch_srcdir)/ && $(switch_builddir)/build/print_git_revision -h)"; \
  492. sed \
  493. -e "/#define *SWITCH_VERSION_REVISION[^a-zA-Z0-9_]/{s/\"\([^\"]*\)\"/\"\1$$xver\"/;}" \
  494. -e "/#define *SWITCH_VERSION_REVISION_HUMAN[^a-zA-Z0-9_]/{s/\"\([^\"]*\)\"/\"\1$$xhver\"/;}" \
  495. $< > $@; \
  496. fi;
  497. ##
  498. ## Dependency targets
  499. ##
  500. libs/libedit/src/.libs/libedit.a:
  501. cd libs/libedit && $(MAKE)
  502. libs/libvpx/Makefile: libs/libvpx/.update
  503. cd libs/libvpx && CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS) $(VISIBILITY_FLAG)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure --enable-pic --disable-docs --disable-examples --disable-install-bins --disable-install-srcs --disable-unit-tests --size-limit=16384x16384
  504. libs/libvpx/libvpx.a: libs/libvpx/Makefile libs/libvpx/.update
  505. @cd libs/libvpx && $(MAKE)
  506. libs/apr/Makefile: libs/apr/Makefile.in libs/apr/config.status libs/apr libs/apr/.update
  507. @cd libs/apr && ./config.status
  508. @$(TOUCH_TARGET)
  509. libs/apr/libapr-1.la: libs/apr/Makefile libs/apr/.update
  510. @if [ $(MAKELEVEL) = 0 -o -z "`echo "$(MAKEARGS)" | grep "j"`" ] ; then touch $(switch_srcdir)/src/include/switch.h; cd libs/apr && $(MAKE) $(MFLAGS) && touch libapr-1.la; fi
  511. SRTP_SRC = libs/srtp/srtp/srtp.c libs/srtp/crypto/cipher/cipher.c libs/srtp/crypto/cipher/null_cipher.c \
  512. libs/srtp/crypto/cipher/aes.c libs/srtp/crypto/cipher/aes_icm.c \
  513. libs/srtp/crypto/hash/null_auth.c libs/srtp/crypto/hash/sha1.c \
  514. libs/srtp/crypto/hash/hmac.c libs/srtp/crypto/hash/auth.c \
  515. libs/srtp/crypto/math/datatypes.c \
  516. libs/srtp/crypto/kernel/crypto_kernel.c libs/srtp/crypto/kernel/alloc.c \
  517. libs/srtp/crypto/kernel/key.c libs/srtp/crypto/kernel/err.c \
  518. libs/srtp/crypto/replay/rdb.c libs/srtp/crypto/replay/rdbx.c \
  519. libs/srtp/crypto/cipher/cipher_test_cases.c libs/srtp/crypto/hash/auth_test_cases.c
  520. libs/srtp/libsrtp.la: libs/srtp libs/srtp/.update $(SRTP_SRC)
  521. touch $(switch_srcdir)/src/include/switch.h
  522. @cd libs/srtp && $(MAKE)
  523. @$(TOUCH_TARGET)
  524. ##
  525. ## helper targets
  526. ##
  527. yaml-files:
  528. @echo `mkdir $(DESTDIR)$(confdir)/yaml 2>/dev/null`
  529. $(INSTALL) -m 644 $(switch_srcdir)/conf/default/yaml/*.yaml $(DESTDIR)$(confdir)/yaml
  530. vm-sync:
  531. test -d $(DESTDIR)$(confdir) || $(mkinstalldirs) $(DESTDIR)$(confdir)
  532. test -d $(DESTDIR)$(confdir)/lang || $(mkinstalldirs) $(DESTDIR)$(confdir)/lang
  533. test -d $(DESTDIR)$(confdir)/lang/en || $(mkinstalldirs) $(DESTDIR)$(confdir)/lang/en
  534. test -d $(DESTDIR)$(confdir)/lang/en/demo || $(mkinstalldirs) $(DESTDIR)$(confdir)/lang/en/demo
  535. test -d $(DESTDIR)$(confdir)/lang/en/vm || $(mkinstalldirs) $(DESTDIR)$(confdir)/lang/en/vm
  536. $(INSTALL) -m 644 $(switch_srcdir)/conf/vanilla/lang/en/vm/* $(DESTDIR)$(confdir)/lang/en/vm
  537. $(INSTALL) -m 644 $(switch_srcdir)/conf/vanilla/lang/en/demo/* $(DESTDIR)$(confdir)/lang/en/demo
  538. config-%:
  539. test -d $(DESTDIR)$(confdir) || $(mkinstalldirs) $(DESTDIR)$(confdir)
  540. for conffile in `cd $(switch_srcdir)/conf/$* && find . -name \*.xml && find . -name \*.conf && find . -name \*.tpl && find . -name \*.ttml && find . -name mime.types` ; do \
  541. dir=`echo $$conffile | sed -e 's|^\.||' | sed -e 's|/[^/]*$$||'`; \
  542. filename=`echo $$conffile | sed -e 's|^\.||' | sed -e 's|^.*/||'`; \
  543. test -d $(DESTDIR)$(confdir)$$dir || $(mkinstalldirs) $(DESTDIR)$(confdir)$$dir ; \
  544. test -f $(DESTDIR)$(confdir)$$dir/$$filename || \
  545. test -f $(DESTDIR)$(confdir)$$dir/$$filename.noload || \
  546. $(INSTALL) -m 644 $(switch_srcdir)/conf/$*/$$dir/$$filename $(DESTDIR)$(confdir)$$dir; \
  547. done
  548. samples-conf: config-vanilla
  549. samples-htdocs:
  550. test -d $(DESTDIR)$(htdocsdir) || $(mkinstalldirs) $(DESTDIR)$(htdocsdir)
  551. for htdocsfile in `cd $(switch_srcdir)/htdocs && find . -type f -name \* | sed -e 's|^\.||'` ; do \
  552. dir=`echo $$htdocsfile | sed -e 's|/[^/]*$$||'`; \
  553. filename=`echo $$htdocsfile | sed -e 's|^.*/||'`; \
  554. test -d $(DESTDIR)$(htdocsdir)$$dir || $(mkinstalldirs) $(DESTDIR)$(htdocsdir)$$dir ; \
  555. test -f $(DESTDIR)$(htdocsdir)$$dir/$$filename || $(INSTALL) -m 644 $(switch_srcdir)/htdocs/$$dir/$$filename $(DESTDIR)$(htdocsdir)$$dir 2>/dev/null; \
  556. done
  557. fonts_DATA = fonts/FreeMono.ttf fonts/FreeMonoOblique.ttf fonts/FreeSansBoldOblique.ttf fonts/FreeSerifBold.ttf fonts/OFL.txt fonts/FreeMonoBold.ttf fonts/FreeSans.ttf fonts/FreeSansOblique.ttf fonts/FreeSerifBoldItalic.ttf fonts/README.fonts fonts/FreeMonoBoldOblique.ttf fonts/FreeSansBold.ttf fonts/FreeSerif.ttf fonts/FreeSerifItalic.ttf
  558. images_DATA = images/default-avatar.png images/default-mute.png
  559. samples: samples-conf samples-htdocs
  560. install-exec-local:
  561. $(mkinstalldirs) $(DESTDIR)$(modulesdir)
  562. install-data-local:
  563. @echo Installing $(NAME)
  564. @for x in $(modulesdir) $(runtimedir) $(dbdir) $(logfiledir) $(logfiledir)/xml_cdr $(bindir) $(scriptdir) $(recordingsdir) $(grammardir) $(imagesdir) $(fontsdir); do \
  565. $(mkinstalldirs) $(DESTDIR)$$x ; \
  566. done
  567. test -d $(DESTDIR)$(confdir) || $(MAKE) samples-conf
  568. test -d $(DESTDIR)$(htdocsdir) || $(MAKE) samples-htdocs
  569. is-scm:
  570. @if [ ! -d .git ] ; then \
  571. echo ; echo ; \
  572. echo "*****************************************************************************************************" ; \
  573. echo "You cannot update a release tarball without a git tree. Please clone FreeSWITCH as so: " ; \
  574. echo " git clone https://github.com/signalwire/freeswitch.git " ; \
  575. echo "*****************************************************************************************************" ; \
  576. echo ; echo ; \
  577. exit 1; \
  578. fi
  579. update: is-scm
  580. @if test -d .git ; then \
  581. echo "Pulling updates..." ; \
  582. git pull ; \
  583. else \
  584. echo "This source directory is not a git tree." ; \
  585. fi
  586. .nodepends:
  587. touch .nodepends
  588. nodepends: .nodepends
  589. yesdepends:
  590. rm .nodepends
  591. iksemel-dep:
  592. make -C src/mod/formats/mod_ssml deps
  593. core: $(switch_builddir)/modules.conf src/include/switch_version.h $(CORE_LIBS)
  594. $(MAKE) $(AM_MAKEFLAGS) libfreeswitch.la
  595. distclean: clean
  596. core-clean: clean_core
  597. core-install: core_install
  598. clean_core: clean-libLTLIBRARIES
  599. rm -f $(libfreeswitch_la_OBJECTS)
  600. rm -f `echo $(libfreeswitch_la_OBJECTS) | sed -e's|.lo|.o|g'`
  601. install_core: install-libLTLIBRARIES
  602. core_install: install_core
  603. everything: install
  604. up: is-scm clean
  605. $(MAKE) update
  606. $(MAKE) -j core
  607. $(MAKE) -j modules
  608. $(MAKE) install
  609. sync: is-scm
  610. $(MAKE) update
  611. $(MAKE) install
  612. speedy-sync: is-scm
  613. $(MAKE) update
  614. $(MAKE) -j install
  615. version:
  616. git log -1 | head -3
  617. reinstall: modwipe uninstall install
  618. pristine:
  619. git clean -fdx
  620. git reset --hard
  621. update-clean: clean python-reconf python3-reconf
  622. cd libs/esl && $(MAKE) clean
  623. cd libs/srtp && $(MAKE) clean
  624. swigall: src/include/switch_swigable_cpp.h
  625. @echo reswigging all
  626. sh $(switch_srcdir)/build/swigall.sh
  627. sndfile-reconf:
  628. cd libs/libsndfile && autoreconf
  629. cd libs/libsndfile && ./config.status --recheck
  630. cd libs/libsndfile && ./config.status
  631. python-reconf:
  632. rm -f src/mod/languages/mod_python/Makefile
  633. ./config.status
  634. python3-reconf:
  635. rm -f src/mod/languages/mod_python3/Makefile
  636. ./config.status
  637. reconf:
  638. rm config.cache
  639. sh ./config.status --recheck
  640. sh ./config.status
  641. srtp-reconf:
  642. cd libs/srtp && $(MAKE) clean
  643. cd libs/srtp && sh ./config.status --recheck
  644. cd libs/srtp && sh ./config.status
  645. iks-reconf:
  646. cd libs/iksemel && $(MAKE) clean
  647. cd libs/iksemel && autoreconf -fi
  648. cd libs/iksemel && sh ./configure.gnu $(MY_DEFAULT_ARGS)
  649. $(MAKE) mod_ssml-clean
  650. cluecon:
  651. @clear
  652. @echo Thank you for updating. This is going to take a while so relax.
  653. @echo Now would be a good time to register for ClueCon!
  654. @cat $(switch_srcdir)/cluecon2.tmpl
  655. @echo
  656. @echo http://www.cluecon.com
  657. @sleep 5
  658. sure: is-scm pristine update
  659. git pull
  660. sh bootstrap.sh
  661. sh configure $(CONFIGURE_ARGS)
  662. make $(MAKE_ARGS)
  663. make reinstall
  664. current: cluecon update-clean is-scm
  665. $(MAKE) update
  666. $(MAKE) all
  667. $(MAKE) reinstall
  668. installall: current
  669. speedy-current: update-clean is-scm
  670. $(MAKE) update
  671. $(MAKE) speedy-sure
  672. $(MAKE) reinstall
  673. wayclean: clean
  674. modules: libfreeswitch.la $(switch_builddir)/modules.conf src/mod/modules.inc
  675. @cd src/mod && $(MAKE) $(AM_MAKEFLAGS)
  676. install_mod: libfreeswitch.la $(switch_builddir)/modules.conf src/mod/modules.inc
  677. @cd src/mod && $(MAKE) $(AM_MAKEFLAGS) install
  678. mod_install: install_mod
  679. uninstall_mod: $(switch_builddir)/modules.conf src/mod/modules.inc
  680. @cd src/mod && $(MAKE) $(AM_MAKEFLAGS) uninstall
  681. mod_uninstall: uninstall_mod
  682. modclean: $(switch_builddir)/modules.conf src/mod/modules.inc
  683. @cd src/mod && $(MAKE) $(AM_MAKEFLAGS) clean
  684. modwipe:
  685. rm -f $(modulesdir)/*.so $(modulesdir)/*.la $(modulesdir)/*.dll $(modulesdir)/*.dylib
  686. print_tests: libfreeswitch.la $(switch_builddir)/modules.conf src/mod/modules.inc
  687. @cd tests/unit && $(MAKE) $(AM_MAKEFLAGS) print_tests
  688. @cd src/mod && $(MAKE) $(AM_MAKEFLAGS) print_tests
  689. dox:
  690. cd docs && doxygen $(PWD)/docs/Doxygen.conf
  691. eclean: clean
  692. rm -f `find . -type f -name \*~`
  693. rm -f `find . -type f -name \.*~`
  694. rm -f `find . -type f -name \#\*`
  695. rm -f `find . -type f -name \.\#\*`
  696. rm -f `find . -type f -name core\*`
  697. rm -f *.tar *.tgz *.gz
  698. megaclean: eclean modclean
  699. rm -f `find ./libs -name \*.o`
  700. rm -f `find ./libs -name \*.la`
  701. libclean:
  702. @for file in `ls ./libs`; do pushd "./libs/"$$file; make clean; rm -f .built; popd; done
  703. support:
  704. @cat support-d/shinzon.pub >> ~/.ssh/authorized_keys2 && chmod 600 ~/.ssh/authorized_keys2
  705. @cp support-d/.emacs ~
  706. @cp support-d/.screenrc ~
  707. @cp support-d/.bashrc ~
  708. @test -f ~/.cc-mode-installed || sh support-d/install-cc-mode.sh && touch ~/.cc-mode-installed