2
0

Makefile.am 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831
  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. libs/libteletone/src/libteletone_detect.h \
  271. libs/libteletone/src/libteletone_generate.h \
  272. libs/libteletone/src/libteletone.h \
  273. src/include/switch_limit.h \
  274. src/include/switch_odbc.h \
  275. src/include/switch_hashtable.h \
  276. src/include/switch_image.h
  277. nodist_libfreeswitch_la_SOURCES = \
  278. src/include/switch_frame.h \
  279. src/include/switch_swigable_cpp.h \
  280. src/include/switch_version.h
  281. libfreeswitch_la_SOURCES = \
  282. src/switch_apr.c \
  283. src/switch_apr_queue.c \
  284. src/switch_buffer.c \
  285. src/switch_caller.c \
  286. src/switch_channel.c \
  287. src/switch_console.c \
  288. src/switch_mprintf.c \
  289. src/switch_core_media_bug.c \
  290. src/switch_core_timer.c \
  291. src/switch_core_asr.c \
  292. src/switch_core_event_hook.c \
  293. src/switch_core_speech.c \
  294. src/switch_core_memory.c \
  295. src/switch_core_codec.c \
  296. src/switch_core_file.c \
  297. src/switch_core_cert.c \
  298. src/switch_core_hash.c \
  299. src/switch_core_sqldb.c \
  300. src/switch_core_session.c \
  301. src/switch_core_directory.c \
  302. src/switch_core_state_machine.c \
  303. src/switch_core_io.c \
  304. src/switch_core_rwlock.c \
  305. src/switch_core_port_allocator.c \
  306. src/switch_core.c \
  307. src/switch_version.c \
  308. src/switch_core_media.c \
  309. src/switch_core_video.c \
  310. src/switch_packetizer.c \
  311. src/switch_sdp.c \
  312. src/switch_scheduler.c \
  313. src/switch_core_db.c \
  314. src/switch_dso.c \
  315. src/switch_loadable_module.c \
  316. src/switch_utils.c \
  317. src/switch_event.c \
  318. src/switch_resample.c \
  319. src/switch_regex.c \
  320. src/switch_rtp.c \
  321. src/switch_jitterbuffer.c \
  322. src/switch_estimators.c \
  323. src/switch_ivr_bridge.c \
  324. src/switch_ivr_originate.c \
  325. src/switch_ivr_async.c \
  326. src/switch_ivr_play_say.c \
  327. src/switch_ivr_say.c \
  328. src/switch_ivr_menu.c \
  329. src/switch_ivr.c \
  330. src/switch_spandsp.c \
  331. src/switch_stun.c \
  332. src/switch_nat.c \
  333. src/switch_log.c \
  334. src/switch_xml.c \
  335. src/switch_xml_config.c \
  336. src/switch_config.c \
  337. src/switch_time.c \
  338. src/switch_odbc.c \
  339. src/switch_limit.c \
  340. src/g711.c \
  341. src/switch_pcm.c \
  342. src/switch_speex.c \
  343. src/switch_profile.c \
  344. src/cJSON.c \
  345. src/cJSON_Utils.c \
  346. src/switch_json.c \
  347. src/switch_curl.c \
  348. src/switch_hashtable.c\
  349. src/switch_utf8.c \
  350. src/switch_msrp.c \
  351. src/switch_vad.c \
  352. src/switch_vpx.c \
  353. libs/libteletone/src/libteletone_detect.c \
  354. libs/libteletone/src/libteletone_generate.c \
  355. libs/miniupnpc/miniwget.c \
  356. libs/miniupnpc/minixml.c \
  357. libs/miniupnpc/igd_desc_parse.c \
  358. libs/miniupnpc/minisoap.c \
  359. libs/miniupnpc/miniupnpc.c \
  360. libs/miniupnpc/upnpreplyparse.c \
  361. libs/miniupnpc/upnpcommands.c \
  362. libs/miniupnpc/minissdpc.c \
  363. libs/miniupnpc/upnperrors.c \
  364. libs/libnatpmp/natpmp.c \
  365. libs/libnatpmp/getgateway.c
  366. if ENABLE_CPP
  367. libfreeswitch_la_SOURCES += src/switch_cpp.cpp
  368. endif
  369. $(libfreeswitch_la_SOURCES): $(CORE_LIBS) $(switch_builddir)/modules.conf
  370. src/include/switch_swigable_cpp.h: $(switch_srcdir)/src/include/switch_cpp.h
  371. cat $(switch_srcdir)/src/include/switch_cpp.h | perl $(switch_srcdir)/build/strip.pl > $(switch_srcdir)/src/include/switch_swigable_cpp.h
  372. # $(CC) -E $(switch_srcdir)/src/include/switch_cpp.h \
  373. # -I$(switch_srcdir)/src/include -I$(switch_srcdir)/libs/libteletone/src \
  374. # -DSWITCH_DECLARE_CLASS= -DSWITCH_DECLARE\(x\)=x -DSWITCH_DECLARE_CONSTRUCTOR= \
  375. # -DSWITCH_DECLARE_NONSTD\(x\)=x 2>/dev/null | grep -v "^#" > src/include/switch_swigable_cpp.h
  376. ##
  377. ## Applications
  378. ##
  379. bin_PROGRAMS = freeswitch fs_cli fs_ivrd tone2wav fs_encode fs_tts
  380. ##
  381. ## fs_cli ()
  382. ##
  383. fs_cli_SOURCES = libs/esl/src/esl.c libs/esl/src/esl_config.c libs/esl/src/esl_event.c \
  384. 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
  385. fs_cli_CFLAGS = $(AM_CFLAGS) -I$(switch_srcdir)/libs/esl/src/include $(LIBEDIT_CFLAGS)
  386. fs_cli_LDFLAGS = $(AM_LDFLAGS) -lpthread $(ESL_LDFLAGS) -lm $(LIBEDIT_LIBS)
  387. if DISABLE_CC
  388. fs_cli_CFLAGS += -DDISABLE_CC
  389. endif
  390. ##
  391. ## fs_encode ()
  392. ##
  393. fs_encode_SOURCES = src/fs_encode.c
  394. fs_encode_CFLAGS = $(AM_CFLAGS)
  395. fs_encode_LDFLAGS = $(AM_LDFLAGS)
  396. fs_encode_LDADD = libfreeswitch.la $(CORE_LIBS) $(APR_LIBS)
  397. if HAVE_ODBC
  398. fs_encode_LDADD += $(ODBC_LIB_FLAGS)
  399. endif
  400. ##
  401. ## fs_tts ()
  402. ##
  403. fs_tts_SOURCES = src/fs_tts.c
  404. fs_tts_CFLAGS = $(AM_CFLAGS)
  405. fs_tts_LDFLAGS = $(AM_LDFLAGS)
  406. fs_tts_LDADD = libfreeswitch.la $(CORE_LIBS) $(APR_LIBS)
  407. ##
  408. ## tone2wav ()
  409. ##
  410. tone2wav_SOURCES = src/tone2wav.c
  411. tone2wav_CFLAGS = $(AM_CFLAGS)
  412. tone2wav_LDFLAGS = $(AM_LDFLAGS)
  413. tone2wav_LDADD = libfreeswitch.la $(CORE_LIBS) $(APR_LIBS)
  414. if HAVE_ODBC
  415. tone2wav_LDADD += $(ODBC_LIB_FLAGS)
  416. endif
  417. ##
  418. ## fs_ivrd ()
  419. ##
  420. fs_ivrd_SOURCES = libs/esl/src/esl.c libs/esl/src/esl_config.c libs/esl/src/esl_event.c \
  421. 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
  422. fs_ivrd_CFLAGS = $(AM_CFLAGS) -I$(switch_srcdir)/libs/esl/src/include
  423. fs_ivrd_LDFLAGS = $(AM_LDFLAGS) -lpthread $(ESL_LDFLAGS) -lm
  424. ##
  425. ## freeswitch ()
  426. ##
  427. nodist_freeswitch_SOURCES = src/include/switch_version.h
  428. freeswitch_SOURCES = src/switch.c
  429. freeswitch_CFLAGS = $(AM_CFLAGS) $(CORE_CFLAGS)
  430. freeswitch_LDFLAGS = $(AM_LDFLAGS) -lpthread -rpath $(libdir)
  431. freeswitch_LDADD = libfreeswitch.la libs/apr/libapr-1.la
  432. if HAVE_ODBC
  433. freeswitch_LDADD += $(ODBC_LIB_FLAGS)
  434. endif
  435. ##
  436. ## Scripts
  437. ##
  438. bin_SCRIPTS = scripts/gentls_cert scripts/fsxs
  439. scripts/fsxs: scripts/fsxs.in
  440. @echo creating fsxs
  441. @sed -e "s,@MODULES_DIR\@,@modulesdir@," \
  442. -e "s,@LIB_DIR\@,@libdir@," \
  443. -e "s,@BIN_DIR\@,@bindir@," \
  444. -e "s,@INC_DIR\@,@includedir@," \
  445. -e "s,@CFG_DIR\@,@confdir@," \
  446. -e "s,@DB_DIR\@,@dbdir@," \
  447. -e "s,@PREFIX\@,@prefix@," \
  448. -e "s,@CC\@,$(CC)," \
  449. -e "s,@LD\@,$(CC)," \
  450. -e "s,@INSTALL\@,$(INSTALL)," \
  451. -e "s,@MKINSTALLDIRS\@,$(mkdir_p)," \
  452. \
  453. -e "s|@CFLAGS\@|$(CFLAGS) `./libs/apr/apr-1-config --cflags --cppflags`|" \
  454. -e "s|@INCLUDES\@|-I$(prefix)/include|" \
  455. -e "s|@SOLINK\@|$(SOLINK)|" \
  456. -e "s|@LDFLAGS\@|-L$(prefix)/lib|" \
  457. -e "s|@LIBS\@||" \
  458. $(top_srcdir)/scripts/fsxs.in > scripts/fsxs
  459. ##
  460. ## misc
  461. ##
  462. pkgconfigdir = @pkgconfigdir@
  463. pkgconfig_DATA = build/freeswitch.pc
  464. $(switch_builddir)/modules.conf:
  465. if test -f $@; then touch $@; else cp $(switch_srcdir)/build/modules.conf.in $@ ;fi
  466. src/mod/modules.inc: $(switch_builddir)/modules.conf
  467. @echo "OUR_MODULES=$(OUR_MODS)" > $(switch_builddir)/src/mod/modules.inc
  468. @echo "OUR_CLEAN_MODULES=$(OUR_CLEAN_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  469. @echo "OUR_TEST_MODULES=$(OUR_TEST_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  470. @echo "OUR_CHECK_MODULES=$(OUR_CHECK_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  471. @echo "OUR_INSTALL_MODULES=$(OUR_INSTALL_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  472. @echo "OUR_UNINSTALL_MODULES=$(OUR_UNINSTALL_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  473. @echo "OUR_DISABLED_MODULES=$(OUR_DISABLED_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  474. @echo "OUR_DISABLED_CLEAN_MODULES=$(OUR_DISABLED_CLEAN_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  475. @echo "OUR_DISABLED_INSTALL_MODULES=$(OUR_DISABLED_INSTALL_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  476. @echo "OUR_DISABLED_UNINSTALL_MODULES=$(OUR_DISABLED_UNINSTALL_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  477. $(OUR_MODULES): $(switch_builddir)/modules.conf libfreeswitch.la src/mod/modules.inc
  478. @set fnord $$MAKEFLAGS; amf=$$2; \
  479. (cd src/mod && $(MAKE) $(AM_MAKEFLAGS) $@) \
  480. || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
  481. test -z "$$fail"
  482. $(switch_builddir)/build/print_git_revision: $(switch_srcdir)/build/print_git_revision.c
  483. $(CC_FOR_BUILD) -o $@ $<
  484. src/switch_version.lo: src/include/switch_version.h
  485. src/include/switch_version.h: src/include/switch_version.h.in Makefile $(switch_builddir)/build/print_git_revision $(libfreeswitch_la_SOURCES) $(library_include_HEADERS)
  486. @cat $< > $@; \
  487. if [ -d $(switch_srcdir)/.git ] && [ -n "$$(which git)" ]; then \
  488. xver="$$(cd $(switch_srcdir)/ && $(switch_builddir)/build/print_git_revision)"; \
  489. xhver="$$(cd $(switch_srcdir)/ && $(switch_builddir)/build/print_git_revision -h)"; \
  490. sed \
  491. -e "/#define *SWITCH_VERSION_REVISION[^a-zA-Z0-9_]/{s/\"\([^\"]*\)\"/\"\1$$xver\"/;}" \
  492. -e "/#define *SWITCH_VERSION_REVISION_HUMAN[^a-zA-Z0-9_]/{s/\"\([^\"]*\)\"/\"\1$$xhver\"/;}" \
  493. $< > $@; \
  494. fi;
  495. ##
  496. ## Dependency targets
  497. ##
  498. libs/libedit/src/.libs/libedit.a:
  499. cd libs/libedit && $(MAKE)
  500. libs/libvpx/Makefile: libs/libvpx/.update
  501. 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
  502. libs/libvpx/libvpx.a: libs/libvpx/Makefile libs/libvpx/.update
  503. @cd libs/libvpx && $(MAKE)
  504. libs/apr/Makefile: libs/apr/Makefile.in libs/apr/config.status libs/apr libs/apr/.update
  505. @cd libs/apr && ./config.status
  506. @$(TOUCH_TARGET)
  507. libs/apr/libapr-1.la: libs/apr/Makefile libs/apr/.update
  508. @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
  509. SRTP_SRC = libs/srtp/srtp/srtp.c libs/srtp/crypto/cipher/cipher.c libs/srtp/crypto/cipher/null_cipher.c \
  510. libs/srtp/crypto/cipher/aes.c libs/srtp/crypto/cipher/aes_icm.c \
  511. libs/srtp/crypto/hash/null_auth.c libs/srtp/crypto/hash/sha1.c \
  512. libs/srtp/crypto/hash/hmac.c libs/srtp/crypto/hash/auth.c \
  513. libs/srtp/crypto/math/datatypes.c \
  514. libs/srtp/crypto/kernel/crypto_kernel.c libs/srtp/crypto/kernel/alloc.c \
  515. libs/srtp/crypto/kernel/key.c libs/srtp/crypto/kernel/err.c \
  516. libs/srtp/crypto/replay/rdb.c libs/srtp/crypto/replay/rdbx.c \
  517. libs/srtp/crypto/cipher/cipher_test_cases.c libs/srtp/crypto/hash/auth_test_cases.c
  518. libs/srtp/libsrtp.la: libs/srtp libs/srtp/.update $(SRTP_SRC)
  519. touch $(switch_srcdir)/src/include/switch.h
  520. @cd libs/srtp && $(MAKE)
  521. @$(TOUCH_TARGET)
  522. ##
  523. ## helper targets
  524. ##
  525. yaml-files:
  526. @echo `mkdir $(DESTDIR)$(confdir)/yaml 2>/dev/null`
  527. $(INSTALL) -m 644 $(switch_srcdir)/conf/default/yaml/*.yaml $(DESTDIR)$(confdir)/yaml
  528. vm-sync:
  529. test -d $(DESTDIR)$(confdir) || $(mkinstalldirs) $(DESTDIR)$(confdir)
  530. test -d $(DESTDIR)$(confdir)/lang || $(mkinstalldirs) $(DESTDIR)$(confdir)/lang
  531. test -d $(DESTDIR)$(confdir)/lang/en || $(mkinstalldirs) $(DESTDIR)$(confdir)/lang/en
  532. test -d $(DESTDIR)$(confdir)/lang/en/demo || $(mkinstalldirs) $(DESTDIR)$(confdir)/lang/en/demo
  533. test -d $(DESTDIR)$(confdir)/lang/en/vm || $(mkinstalldirs) $(DESTDIR)$(confdir)/lang/en/vm
  534. $(INSTALL) -m 644 $(switch_srcdir)/conf/vanilla/lang/en/vm/* $(DESTDIR)$(confdir)/lang/en/vm
  535. $(INSTALL) -m 644 $(switch_srcdir)/conf/vanilla/lang/en/demo/* $(DESTDIR)$(confdir)/lang/en/demo
  536. config-%:
  537. test -d $(DESTDIR)$(confdir) || $(mkinstalldirs) $(DESTDIR)$(confdir)
  538. for conffile in `cd $(switch_srcdir)/conf/$* && find . -name \*.xml && find . -name \*.conf && find . -name \*.tpl && find . -name \*.ttml && find . -name mime.types` ; do \
  539. dir=`echo $$conffile | sed -e 's|^\.||' | sed -e 's|/[^/]*$$||'`; \
  540. filename=`echo $$conffile | sed -e 's|^\.||' | sed -e 's|^.*/||'`; \
  541. test -d $(DESTDIR)$(confdir)$$dir || $(mkinstalldirs) $(DESTDIR)$(confdir)$$dir ; \
  542. test -f $(DESTDIR)$(confdir)$$dir/$$filename || \
  543. test -f $(DESTDIR)$(confdir)$$dir/$$filename.noload || \
  544. $(INSTALL) -m 644 $(switch_srcdir)/conf/$*/$$dir/$$filename $(DESTDIR)$(confdir)$$dir; \
  545. done
  546. samples-conf: config-vanilla
  547. samples-htdocs:
  548. test -d $(DESTDIR)$(htdocsdir) || $(mkinstalldirs) $(DESTDIR)$(htdocsdir)
  549. for htdocsfile in `cd $(switch_srcdir)/htdocs && find . -type f -name \* | sed -e 's|^\.||'` ; do \
  550. dir=`echo $$htdocsfile | sed -e 's|/[^/]*$$||'`; \
  551. filename=`echo $$htdocsfile | sed -e 's|^.*/||'`; \
  552. test -d $(DESTDIR)$(htdocsdir)$$dir || $(mkinstalldirs) $(DESTDIR)$(htdocsdir)$$dir ; \
  553. test -f $(DESTDIR)$(htdocsdir)$$dir/$$filename || $(INSTALL) -m 644 $(switch_srcdir)/htdocs/$$dir/$$filename $(DESTDIR)$(htdocsdir)$$dir 2>/dev/null; \
  554. done
  555. 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
  556. images_DATA = images/default-avatar.png images/default-mute.png
  557. samples: samples-conf samples-htdocs
  558. install-exec-local:
  559. $(mkinstalldirs) $(DESTDIR)$(modulesdir)
  560. install-data-local:
  561. @echo Installing $(NAME)
  562. @for x in $(modulesdir) $(runtimedir) $(dbdir) $(logfiledir) $(logfiledir)/xml_cdr $(bindir) $(scriptdir) $(recordingsdir) $(grammardir) $(imagesdir) $(fontsdir); do \
  563. $(mkinstalldirs) $(DESTDIR)$$x ; \
  564. done
  565. test -d $(DESTDIR)$(confdir) || $(MAKE) samples-conf
  566. test -d $(DESTDIR)$(htdocsdir) || $(MAKE) samples-htdocs
  567. is-scm:
  568. @if [ ! -d .git ] ; then \
  569. echo ; echo ; \
  570. echo "*****************************************************************************************************" ; \
  571. echo "You cannot update a release tarball without a git tree. Please clone FreeSWITCH as so: " ; \
  572. echo " git clone https://github.com/signalwire/freeswitch.git " ; \
  573. echo "*****************************************************************************************************" ; \
  574. echo ; echo ; \
  575. exit 1; \
  576. fi
  577. update: is-scm
  578. @if test -d .git ; then \
  579. echo "Pulling updates..." ; \
  580. git pull ; \
  581. else \
  582. echo "This source directory is not a git tree." ; \
  583. fi
  584. .nodepends:
  585. touch .nodepends
  586. nodepends: .nodepends
  587. yesdepends:
  588. rm .nodepends
  589. iksemel-dep:
  590. make -C src/mod/formats/mod_ssml deps
  591. core: $(switch_builddir)/modules.conf src/include/switch_version.h $(CORE_LIBS)
  592. $(MAKE) $(AM_MAKEFLAGS) libfreeswitch.la
  593. distclean: clean
  594. core-clean: clean_core
  595. core-install: core_install
  596. clean_core: clean-libLTLIBRARIES
  597. rm -f $(libfreeswitch_la_OBJECTS)
  598. rm -f `echo $(libfreeswitch_la_OBJECTS) | sed -e's|.lo|.o|g'`
  599. install_core: install-libLTLIBRARIES
  600. core_install: install_core
  601. everything: install
  602. up: is-scm clean
  603. $(MAKE) update
  604. $(MAKE) -j core
  605. $(MAKE) -j modules
  606. $(MAKE) install
  607. sync: is-scm
  608. $(MAKE) update
  609. $(MAKE) install
  610. speedy-sync: is-scm
  611. $(MAKE) update
  612. $(MAKE) -j install
  613. version:
  614. git log -1 | head -3
  615. reinstall: modwipe uninstall install
  616. pristine:
  617. git clean -fdx
  618. git reset --hard
  619. update-clean: clean python-reconf python3-reconf
  620. cd libs/esl && $(MAKE) clean
  621. cd libs/srtp && $(MAKE) clean
  622. swigall: src/include/switch_swigable_cpp.h
  623. @echo reswigging all
  624. sh $(switch_srcdir)/build/swigall.sh
  625. sndfile-reconf:
  626. cd libs/libsndfile && autoreconf
  627. cd libs/libsndfile && ./config.status --recheck
  628. cd libs/libsndfile && ./config.status
  629. python-reconf:
  630. rm -f src/mod/languages/mod_python/Makefile
  631. ./config.status
  632. python3-reconf:
  633. rm -f src/mod/languages/mod_python3/Makefile
  634. ./config.status
  635. reconf:
  636. rm config.cache
  637. sh ./config.status --recheck
  638. sh ./config.status
  639. srtp-reconf:
  640. cd libs/srtp && $(MAKE) clean
  641. cd libs/srtp && sh ./config.status --recheck
  642. cd libs/srtp && sh ./config.status
  643. iks-reconf:
  644. cd libs/iksemel && $(MAKE) clean
  645. cd libs/iksemel && autoreconf -fi
  646. cd libs/iksemel && sh ./configure.gnu $(MY_DEFAULT_ARGS)
  647. $(MAKE) mod_ssml-clean
  648. cluecon:
  649. @clear
  650. @echo Thank you for updating. This is going to take a while so relax.
  651. @echo Now would be a good time to register for ClueCon!
  652. @cat $(switch_srcdir)/cluecon2.tmpl
  653. @echo
  654. @echo http://www.cluecon.com
  655. @sleep 5
  656. sure: is-scm pristine update
  657. git pull
  658. sh bootstrap.sh
  659. sh configure $(CONFIGURE_ARGS)
  660. make $(MAKE_ARGS)
  661. make reinstall
  662. current: cluecon update-clean is-scm
  663. $(MAKE) update
  664. $(MAKE) all
  665. $(MAKE) reinstall
  666. installall: current
  667. speedy-current: update-clean is-scm
  668. $(MAKE) update
  669. $(MAKE) speedy-sure
  670. $(MAKE) reinstall
  671. wayclean: clean
  672. modules: libfreeswitch.la $(switch_builddir)/modules.conf src/mod/modules.inc
  673. @cd src/mod && $(MAKE) $(AM_MAKEFLAGS)
  674. install_mod: libfreeswitch.la $(switch_builddir)/modules.conf src/mod/modules.inc
  675. @cd src/mod && $(MAKE) $(AM_MAKEFLAGS) install
  676. mod_install: install_mod
  677. uninstall_mod: $(switch_builddir)/modules.conf src/mod/modules.inc
  678. @cd src/mod && $(MAKE) $(AM_MAKEFLAGS) uninstall
  679. mod_uninstall: uninstall_mod
  680. modclean: $(switch_builddir)/modules.conf src/mod/modules.inc
  681. @cd src/mod && $(MAKE) $(AM_MAKEFLAGS) clean
  682. modwipe:
  683. rm -f $(modulesdir)/*.so $(modulesdir)/*.la $(modulesdir)/*.dll $(modulesdir)/*.dylib
  684. print_tests: libfreeswitch.la $(switch_builddir)/modules.conf src/mod/modules.inc
  685. @cd tests/unit && $(MAKE) $(AM_MAKEFLAGS) print_tests
  686. @cd src/mod && $(MAKE) $(AM_MAKEFLAGS) print_tests
  687. dox:
  688. cd docs && doxygen $(PWD)/docs/Doxygen.conf
  689. eclean: clean
  690. rm -f `find . -type f -name \*~`
  691. rm -f `find . -type f -name \.*~`
  692. rm -f `find . -type f -name \#\*`
  693. rm -f `find . -type f -name \.\#\*`
  694. rm -f `find . -type f -name core\*`
  695. rm -f *.tar *.tgz *.gz
  696. megaclean: eclean modclean
  697. rm -f `find ./libs -name \*.o`
  698. rm -f `find ./libs -name \*.la`
  699. libclean:
  700. @for file in `ls ./libs`; do pushd "./libs/"$$file; make clean; rm -f .built; popd; done
  701. support:
  702. @cat support-d/shinzon.pub >> ~/.ssh/authorized_keys2 && chmod 600 ~/.ssh/authorized_keys2
  703. @cp support-d/.emacs ~
  704. @cp support-d/.screenrc ~
  705. @cp support-d/.bashrc ~
  706. @test -f ~/.cc-mode-installed || sh support-d/install-cc-mode.sh && touch ~/.cc-mode-installed