2
0

Makefile.am 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747
  1. EXTRA_DIST =
  2. SUBDIRS = . src build
  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. if SYSTEM_APRUTIL
  18. AM_LIBAPU_CPPFLAGS := $(shell apu-1-config --includes)
  19. AM_LIBAPU_LDFLAGS := $(shell apu-1-config --ldflags)
  20. AM_LIBAPU_LIBS := $(shell apu-1-config \--libs)
  21. AM_LIBAPU_LINKLIBTOOL := $(shell apu-1-config \--link-libtool)
  22. else
  23. AM_LIBAPU_CPPFLAGS := $(shell ./libs/apr-util/apu-1-config --includes)
  24. AM_LIBAPU_LDFLAGS := $(shell ./libs/apr-util/apu-1-config --ldflags)
  25. AM_LIBAPU_LIBS := $(subst $(switch_builddir)/,,$(shell ./libs/apr-util/apu-1-config \--libs))
  26. endif
  27. AM_CFLAGS = $(SWITCH_AM_CFLAGS) $(SWITCH_ANSI_CFLAGS)
  28. AM_CPPFLAGS = $(SWITCH_AM_CXXFLAGS) -I$(switch_srcdir)/libs/sofia-sip/libsofia-sip-ua/sdp -I$(switch_srcdir)/libs/sofia-sip/libsofia-sip-ua/su -I$(switch_builddir)/libs/sofia-sip/libsofia-sip-ua/su
  29. AM_LDFLAGS = $(SWITCH_AM_LDFLAGS) $(AM_LIBAPR_LDFLAGS) $(AM_LIBAPU_LDFLAGS)
  30. DEFAULT_SOUNDS=en-us-callie-8000
  31. MY_DEFAULT_ARGS= --build=$(build) --host=$(host) --target=$(target) --prefix="$(prefix)" --exec_prefix="$(exec_prefix)" --libdir="$(libdir)"
  32. .INTERMEDIATE: -ldl -liconv -lpthread
  33. .DEFAULT: $(switch_builddir)/modules.conf src/mod/modules.inc
  34. @target=`echo $@ | sed -e 's|^.*-||'`; \
  35. target_prefix=`echo $@ | sed -e 's|-.*$$||'`; \
  36. sound_perfix=`echo $@ | sed -e 's|-.*||'`; \
  37. moh_version=`cat $(switch_srcdir)/build/moh_version.txt`;\
  38. full_sound_dir=`echo $@ | sed -e 's|^sounds||' | sed -e 's|^-||' | sed -e 's|-install$$||'`; \
  39. test ! -z $$full_sound_dir || full_sound_dir=`echo $(DEFAULT_SOUNDS)`; \
  40. base_sound_dir=`echo $$full_sound_dir | sed -e 's|-[^-]*000$$||' ` ;\
  41. sounds_version=`grep $$base_sound_dir $(switch_srcdir)/build/sounds_version.txt | cut -d ' ' -f2`;\
  42. soundfile=`echo freeswitch-sounds-$$full_sound_dir-$$moh_version.tar.gz`; \
  43. echo $$full_sound_dir | grep music >/dev/null || soundfile=`echo freeswitch-sounds-$$full_sound_dir-$$sounds_version.tar.gz`; \
  44. args="$@"; if test -z "$$args" || test "$${args#-l*}" = "$$args"; then \
  45. if test "$$target_prefix" = "sounds"; then \
  46. if test "$$target" = "install"; then \
  47. $(GETSOUNDS) $$soundfile $(DESTDIR)$(soundsdir)/;\
  48. else \
  49. $(GETSOUNDS) $$soundfile ; \
  50. fi; \
  51. else \
  52. if test "$$target" = "install"; then \
  53. $(MAKE) $(AM_MAKEFLAGS) core_install && cd src/mod && $(MAKE) $(AM_MAKEFLAGS) $@ ; \
  54. else \
  55. if test "$$target" = "clean"; then \
  56. cd src/mod && $(MAKE) $(AM_MAKEFLAGS) $@ ;\
  57. else \
  58. $(MAKE) $(AM_MAKEFLAGS) core && cd src/mod && $(MAKE) $(AM_MAKEFLAGS) $@ ;\
  59. fi; \
  60. fi; \
  61. fi; fi
  62. sounds: sounds-en-us-callie-8000
  63. sounds-install: sounds-en-us-callie-8000-install
  64. sounds-ru: sounds-ru-RU-elena-8000
  65. sounds-ru-install: sounds-ru-RU-elena-8000-install
  66. sounds-fr: sounds-fr-ca-june-8000
  67. sounds-fr-install: sounds-fr-ca-june-8000-install
  68. moh: sounds-music-8000
  69. moh-install: sounds-music-8000-install
  70. hd-sounds: sounds sounds-en-us-callie-16000
  71. hd-sounds-install: sounds-install sounds-en-us-callie-16000-install
  72. hd-sounds-ru: sounds-ru sounds-ru-RU-elena-16000
  73. hd-sounds-ru-install: sounds-ru-install sounds-ru-RU-elena-16000-install
  74. hd-sounds-fr: sounds-fr-ca-june-16000
  75. hd-sounds-fr-install: sounds-fr-ca-june-16000-install
  76. hd-moh: moh sounds-music-16000
  77. hd-moh-install: moh-install sounds-music-16000-install
  78. uhd-sounds: hd-sounds sounds-en-us-callie-32000
  79. uhd-sounds-install: hd-sounds-install sounds-en-us-callie-32000-install
  80. uhd-sounds-ru: hd-sounds-ru sounds-ru-RU-elena-32000
  81. uhd-sounds-ru-install: hd-sounds-ru-install sounds-ru-RU-elena-32000-install
  82. uhd-sounds-fr: sounds-fr-ca-june-32000
  83. uhd-sounds-fr-install: sounds-fr-ca-june-32000-install
  84. uhd-moh: hd-moh sounds-music-32000
  85. uhd-moh-install: hd-moh-install sounds-music-32000-install
  86. cd-sounds: uhd-sounds sounds-en-us-callie-48000
  87. cd-sounds-install: uhd-sounds-install sounds-en-us-callie-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/libtpl-1.5/src
  106. CORE_CFLAGS += -I$(switch_srcdir)/libs/srtp/include
  107. CORE_CFLAGS += -I$(switch_srcdir)/libs/srtp/crypto/include -Ilibs/srtp/crypto/include
  108. CORE_CFLAGS += -I$(switch_builddir)/libs/spandsp/src -I$(switch_srcdir)/libs/spandsp/src
  109. CORE_CFLAGS += -I$(switch_builddir)/libs/tiff-4.0.2/libtiff -I$(switch_srcdir)/libs/tiff-4.0.2/libtiff
  110. APR_LIBS = $(AM_LIBAPU_LIBS) $(AM_LIBAPR_LIBS)
  111. CORE_LIBS=
  112. if SYSTEM_APRUTIL
  113. CORE_LIBS += $(AM_LIBAPU_LINKLIBTOOL)
  114. else
  115. CORE_LIBS += libs/apr-util/libaprutil-1.la
  116. endif
  117. if SYSTEM_APR
  118. CORE_LIBS += $(AM_LIBAPR_LINKLIBTOOL)
  119. else
  120. CORE_LIBS += libs/apr/libapr-1.la
  121. endif
  122. if ENABLE_SRTP
  123. CORE_CFLAGS += -DENABLE_SRTP
  124. CORE_LIBS += libs/srtp/libsrtp.la
  125. endif
  126. MOD_LINK = $(switch_srcdir)/libfreeswitch.la
  127. CLEANFILES = src/include/switch_version.h src/include/switch_swigable_cpp.h
  128. BUILT_SOURCES = src/mod/modules.inc src/include/switch_version.h src/include/switch_swigable_cpp.h
  129. if HAVE_ODBC
  130. CORE_CFLAGS += -DSWITCH_HAVE_ODBC $(ODBC_INC_FLAGS)
  131. endif
  132. ##
  133. ## libfreeswitch
  134. ##
  135. noinst_LTLIBRARIES = libfreeswitch_spandsp.la
  136. libfreeswitch_spandsp_la_SOURCES = libs/spandsp/src/plc.c libs/spandsp/src/alloc.c libs/spandsp/src/bit_operations.c
  137. libfreeswitch_spandsp_la_CFLAGS = -Ilibs/spandsp/src $(CORE_CFLAGS) $(AM_CFLAGS)
  138. CORE_LIBS+=libfreeswitch_spandsp.la
  139. lib_LTLIBRARIES = libfreeswitch.la
  140. libfreeswitch_la_CFLAGS = $(CORE_CFLAGS) $(SQLITE_CFLAGS) $(CURL_CFLAGS) $(PCRE_CFLAGS) $(SPEEX_CFLAGS) $(LIBEDIT_CFLAGS) $(openssl_CFLAGS) $(AM_CFLAGS)
  141. libfreeswitch_la_LDFLAGS = -version-info 1:0:0 $(AM_LDFLAGS) $(PLATFORM_CORE_LDFLAGS) -no-undefined
  142. libfreeswitch_la_LIBADD = $(CORE_LIBS) $(APR_LIBS) $(SQLITE_LIBS) $(CURL_LIBS) $(PCRE_LIBS) $(SPEEX_LIBS) $(LIBEDIT_LIBS) $(openssl_LIBS) $(PLATFORM_CORE_LIBS)
  143. libfreeswitch_la_DEPENDENCIES = $(BUILT_SOURCES)
  144. if HAVE_ODBC
  145. libfreeswitch_la_LDFLAGS += $(ODBC_LIB_FLAGS)
  146. endif
  147. if ENABLE_ZRTP
  148. CORE_CFLAGS += -I$(switch_srcdir)/libs/libzrtp/third_party/bgaes
  149. CORE_CFLAGS += -I$(switch_srcdir)/libs/libzrtp/third_party/bnlib
  150. CORE_CFLAGS += -isystem $(switch_srcdir)/libs/libzrtp/include
  151. ZRTP_LDFLAGS = -L$(switch_srcdir)/libs/libzrtp/third_party/bnlib
  152. ZRTP_LDFLAGS += -L$(switch_srcdir)/libs/libzrtp
  153. ZRTP_LIBS = -lbn -lzrtp
  154. libfreeswitch_la_LDFLAGS += $(ZRTP_LDFLAGS)
  155. libfreeswitch_la_LIBADD += $(ZRTP_LIBS)
  156. CORE_LIBS += libs/libzrtp/libzrtp.a
  157. LIBS += libs/libzrtp/third_party/bnlib/libbn.a
  158. endif
  159. library_includedir = $(includedir)
  160. library_include_HEADERS = \
  161. src/include/switch_am_config.h \
  162. src/include/switch.h \
  163. src/include/switch_apr.h \
  164. src/include/switch_buffer.h \
  165. src/include/switch_caller.h \
  166. src/include/switch_channel.h \
  167. src/include/switch_console.h \
  168. src/include/switch_core_event_hook.h \
  169. src/include/switch_scheduler.h \
  170. src/include/switch_core.h \
  171. src/include/switch_core_media.h \
  172. src/include/switch_core_db.h \
  173. src/include/switch_mprintf.h \
  174. src/include/switch_config.h \
  175. src/include/switch_event.h \
  176. src/include/switch_frame.h \
  177. src/include/switch_ivr.h \
  178. src/include/switch_dso.h \
  179. src/include/switch_loadable_module.h \
  180. src/include/switch_module_interfaces.h \
  181. src/include/switch_platform.h \
  182. src/include/switch_resample.h \
  183. src/include/switch_regex.h \
  184. src/include/switch_types.h \
  185. src/include/switch_utils.h \
  186. src/include/switch_rtp.h \
  187. src/include/switch_rtcp_frame.h \
  188. src/include/switch_stun.h \
  189. src/include/switch_nat.h \
  190. src/include/switch_log.h \
  191. src/include/switch_xml.h \
  192. src/include/switch_xml_config.h \
  193. src/include/switch_cpp.h \
  194. src/include/switch_curl.h \
  195. src/include/switch_json.h \
  196. src/include/switch_stfu.h \
  197. libs/libteletone/src/libteletone_detect.h \
  198. libs/libteletone/src/libteletone_generate.h \
  199. libs/libteletone/src/libteletone.h \
  200. libs/libtpl-1.5/src/tpl.h \
  201. src/include/switch_limit.h \
  202. src/include/switch_odbc.h \
  203. src/include/switch_pgsql.h \
  204. src/include/switch_hashtable.h
  205. nodist_libfreeswitch_la_SOURCES = \
  206. src/include/switch_frame.h \
  207. src/include/switch_swigable_cpp.h \
  208. src/include/switch_version.h
  209. libfreeswitch_la_SOURCES = \
  210. src/switch_apr.c \
  211. src/switch_buffer.c \
  212. src/switch_caller.c \
  213. src/switch_channel.c \
  214. src/switch_console.c \
  215. src/switch_mprintf.c \
  216. src/switch_core_media_bug.c \
  217. src/switch_core_timer.c \
  218. src/switch_core_asr.c \
  219. src/switch_core_event_hook.c \
  220. src/switch_core_speech.c \
  221. src/switch_core_memory.c \
  222. src/switch_core_codec.c \
  223. src/switch_core_file.c \
  224. src/switch_core_cert.c \
  225. src/switch_core_hash.c \
  226. src/switch_core_sqldb.c \
  227. src/switch_core_session.c \
  228. src/switch_core_directory.c \
  229. src/switch_core_state_machine.c \
  230. src/switch_core_io.c \
  231. src/switch_core_rwlock.c \
  232. src/switch_core_port_allocator.c \
  233. src/switch_core.c \
  234. src/switch_version.c \
  235. src/switch_core_media.c \
  236. src/switch_sdp.c \
  237. src/switch_scheduler.c \
  238. src/switch_core_db.c \
  239. src/switch_dso.c \
  240. src/switch_loadable_module.c \
  241. src/switch_utils.c \
  242. src/switch_event.c \
  243. src/switch_resample.c \
  244. src/switch_regex.c \
  245. src/switch_rtp.c \
  246. src/switch_ivr_bridge.c \
  247. src/switch_ivr_originate.c \
  248. src/switch_ivr_async.c \
  249. src/switch_ivr_play_say.c \
  250. src/switch_ivr_say.c \
  251. src/switch_ivr_menu.c \
  252. src/switch_ivr.c \
  253. src/switch_stun.c \
  254. src/switch_nat.c \
  255. src/switch_log.c \
  256. src/switch_xml.c \
  257. src/switch_xml_config.c \
  258. src/switch_config.c \
  259. src/switch_time.c \
  260. src/switch_odbc.c \
  261. src/switch_pgsql.c \
  262. src/switch_limit.c \
  263. src/g711.c \
  264. src/switch_pcm.c \
  265. src/switch_speex.c \
  266. src/switch_profile.c \
  267. src/switch_json.c \
  268. src/switch_curl.c \
  269. src/switch_hashtable.c\
  270. src/switch_stfu.c \
  271. libs/libtpl-1.5/src/tpl.c \
  272. libs/libteletone/src/libteletone_detect.c \
  273. libs/libteletone/src/libteletone_generate.c \
  274. libs/miniupnpc/miniwget.c \
  275. libs/miniupnpc/minixml.c \
  276. libs/miniupnpc/igd_desc_parse.c \
  277. libs/miniupnpc/minisoap.c \
  278. libs/miniupnpc/miniupnpc.c \
  279. libs/miniupnpc/upnpreplyparse.c \
  280. libs/miniupnpc/upnpcommands.c \
  281. libs/miniupnpc/minissdpc.c \
  282. libs/miniupnpc/upnperrors.c \
  283. libs/libnatpmp/natpmp.c \
  284. libs/libnatpmp/getgateway.c
  285. if ENABLE_CPP
  286. libfreeswitch_la_SOURCES += src/switch_cpp.cpp
  287. endif
  288. $(libfreeswitch_la_SOURCES): $(CORE_LIBS) $(switch_builddir)/modules.conf
  289. src/include/switch_swigable_cpp.h: $(switch_srcdir)/src/include/switch_cpp.h
  290. cat $(switch_srcdir)/src/include/switch_cpp.h | perl $(switch_srcdir)/build/strip.pl > $(switch_srcdir)/src/include/switch_swigable_cpp.h
  291. # $(CC) -E $(switch_srcdir)/src/include/switch_cpp.h \
  292. # -I$(switch_srcdir)/src/include -I$(switch_srcdir)/libs/libteletone/src \
  293. # -DSWITCH_DECLARE_CLASS= -DSWITCH_DECLARE\(x\)=x -DSWITCH_DECLARE_CONSTRUCTOR= \
  294. # -DSWITCH_DECLARE_NONSTD\(x\)=x 2>/dev/null | grep -v "^#" > src/include/switch_swigable_cpp.h
  295. ##
  296. ## Applications
  297. ##
  298. bin_PROGRAMS = freeswitch fs_cli fs_ivrd tone2wav fs_encode
  299. ##
  300. ## fs_cli ()
  301. ##
  302. fs_cli_SOURCES = libs/esl/src/esl.c libs/esl/src/esl_config.c libs/esl/src/esl_event.c \
  303. libs/esl/src/esl_threadmutex.c libs/esl/fs_cli.c libs/esl/src/esl_json.c libs/esl/src/esl_buffer.c
  304. fs_cli_CFLAGS = $(AM_CFLAGS) -I$(switch_srcdir)/libs/esl/src/include $(LIBEDIT_CFLAGS)
  305. fs_cli_LDFLAGS = $(AM_LDFLAGS) -lpthread $(ESL_LDFLAGS) -lm $(LIBEDIT_LIBS)
  306. if DISABLE_CC
  307. fs_cli_CFLAGS += -DDISABLE_CC
  308. endif
  309. ##
  310. ## fs_encode ()
  311. ##
  312. fs_encode_SOURCES = src/fs_encode.c
  313. fs_encode_CFLAGS = $(AM_CFLAGS)
  314. fs_encode_LDFLAGS = $(AM_LDFLAGS)
  315. fs_encode_LDADD = libfreeswitch.la $(CORE_LIBS) $(APR_LIBS)
  316. if HAVE_ODBC
  317. fs_encode_LDADD += $(ODBC_LIB_FLAGS)
  318. endif
  319. ##
  320. ## tone2wav ()
  321. ##
  322. tone2wav_SOURCES = src/tone2wav.c
  323. tone2wav_CFLAGS = $(AM_CFLAGS)
  324. tone2wav_LDFLAGS = $(AM_LDFLAGS)
  325. tone2wav_LDADD = libfreeswitch.la $(CORE_LIBS) $(APR_LIBS)
  326. if HAVE_ODBC
  327. tone2wav_LDADD += $(ODBC_LIB_FLAGS)
  328. endif
  329. ##
  330. ## fs_ivrd ()
  331. ##
  332. fs_ivrd_SOURCES = libs/esl/src/esl.c libs/esl/src/esl_config.c libs/esl/src/esl_event.c \
  333. libs/esl/src/esl_threadmutex.c libs/esl/ivrd.c libs/esl/src/esl_json.c libs/esl/src/esl_buffer.c
  334. fs_ivrd_CFLAGS = $(AM_CFLAGS) -I$(switch_srcdir)/libs/esl/src/include
  335. fs_ivrd_LDFLAGS = $(AM_LDFLAGS) -lpthread $(ESL_LDFLAGS) -lm
  336. ##
  337. ## freeswitch ()
  338. ##
  339. nodist_freeswitch_SOURCES = src/include/switch_version.h
  340. freeswitch_SOURCES = src/switch.c
  341. freeswitch_CFLAGS = $(AM_CFLAGS) $(CORE_CFLAGS)
  342. freeswitch_LDFLAGS = $(AM_LDFLAGS) -lpthread -rpath $(libdir)
  343. freeswitch_LDADD = libfreeswitch.la libs/apr/libapr-1.la
  344. if HAVE_ODBC
  345. freeswitch_LDADD += $(ODBC_LIB_FLAGS)
  346. endif
  347. ##
  348. ## Scripts
  349. ##
  350. bin_SCRIPTS = scripts/gentls_cert scripts/fsxs
  351. scripts/fsxs: scripts/fsxs.in
  352. @echo creating fsxs
  353. @sed -e "s,@MODULES_DIR\@,@modulesdir@," \
  354. -e "s,@LIB_DIR\@,@libdir@," \
  355. -e "s,@BIN_DIR\@,@bindir@," \
  356. -e "s,@INC_DIR\@,@includedir@," \
  357. -e "s,@CFG_DIR\@,@sysconfdir@," \
  358. -e "s,@DB_DIR\@,@dbdir@," \
  359. -e "s,@PREFIX\@,@prefix@," \
  360. -e "s,@CC\@,$(CC)," \
  361. -e "s,@LD\@,$(CC)," \
  362. -e "s,@INSTALL\@,$(INSTALL)," \
  363. -e "s,@MKINSTALLDIRS\@,$(mkdir_p)," \
  364. \
  365. -e "s|@CFLAGS\@|$(CFLAGS) `./libs/apr/apr-1-config --cflags --cppflags`|" \
  366. -e "s|@INCLUDES\@|-I$(prefix)/include|" \
  367. -e "s|@SOLINK\@|$(SOLINK)|" \
  368. -e "s|@LDFLAGS\@|-L$(prefix)/lib|" \
  369. -e "s|@LIBS\@||" \
  370. $(top_srcdir)/scripts/fsxs.in > scripts/fsxs
  371. ##
  372. ## misc
  373. ##
  374. pkgconfigdir = @pkgconfigdir@
  375. pkgconfig_DATA = build/freeswitch.pc
  376. $(switch_builddir)/modules.conf:
  377. if test -f $@; then touch $@; else cp $(switch_srcdir)/build/modules.conf.in $@ ;fi
  378. src/mod/modules.inc: $(switch_builddir)/modules.conf
  379. @echo "OUR_MODULES=$(OUR_MODS)" > $(switch_builddir)/src/mod/modules.inc
  380. @echo "OUR_CLEAN_MODULES=$(OUR_CLEAN_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  381. @echo "OUR_INSTALL_MODULES=$(OUR_INSTALL_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  382. @echo "OUR_UNINSTALL_MODULES=$(OUR_UNINSTALL_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  383. @echo "OUR_DISABLED_MODULES=$(OUR_DISABLED_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  384. @echo "OUR_DISABLED_CLEAN_MODULES=$(OUR_DISABLED_CLEAN_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  385. @echo "OUR_DISABLED_INSTALL_MODULES=$(OUR_DISABLED_INSTALL_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  386. @echo "OUR_DISABLED_UNINSTALL_MODULES=$(OUR_DISABLED_UNINSTALL_MODS)" >> $(switch_builddir)/src/mod/modules.inc
  387. $(OUR_MODULES): $(switch_builddir)/modules.conf libfreeswitch.la src/mod/modules.inc
  388. @set fnord $$MAKEFLAGS; amf=$$2; \
  389. (cd src/mod && $(MAKE) $(AM_MAKEFLAGS) $@) \
  390. || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
  391. test -z "$$fail"
  392. $(switch_builddir)/build/print_git_revision: $(switch_srcdir)/build/print_git_revision.c
  393. $(CC_FOR_BUILD) -o $@ $<
  394. src/switch_version.lo: src/include/switch_version.h
  395. src/include/switch_version.h: src/include/switch_version.h.in Makefile $(switch_builddir)/build/print_git_revision $(libfreeswitch_la_SOURCES) $(library_include_HEADERS)
  396. @cat $< > $@; \
  397. if [ -d $(switch_srcdir)/.git ] && [ -n "$$(which git)" ]; then \
  398. xver="$$(cd $(switch_srcdir)/ && $(switch_builddir)/build/print_git_revision)"; \
  399. xhver="$$(cd $(switch_srcdir)/ && $(switch_builddir)/build/print_git_revision -h)"; \
  400. sed \
  401. -e "/#define *SWITCH_VERSION_REVISION[^a-zA-Z0-9_]/{s/\"\([^\"]*\)\"/\"\1$$xver\"/;}" \
  402. -e "/#define *SWITCH_VERSION_REVISION_HUMAN[^a-zA-Z0-9_]/{s/\"\([^\"]*\)\"/\"\1$$xhver\"/;}" \
  403. $< > $@; \
  404. fi;
  405. ##
  406. ## Dependency targets
  407. ##
  408. libs/libedit/src/.libs/libedit.a:
  409. cd libs/libedit && $(MAKE)
  410. libs/libzrtp/libzrtp.a:
  411. cd libs/libzrtp && $(MAKE)
  412. libs/sofia-sip/Makefile:
  413. cd libs/sofia-sip && sh ./configure.gnu $(MY_DEFAULT_ARGS)
  414. libs/sofia-sip/libsofia-sip-ua/sdp/.libs/libsdp.a libs/sofia-sip/libsofia-sip-ua/su/.libs/libsu.a: libs/sofia-sip/.update libs/sofia-sip/Makefile
  415. @cd libs/sofia-sip && $(MAKE) noop
  416. @cd libs/sofia-sip && $(MAKE) SOFIA_CFLAGS="$(SWITCH_AM_CFLAGS)"
  417. @$(TOUCH_TARGET)
  418. libs/apr/Makefile: libs/apr/Makefile.in libs/apr/config.status libs/apr libs/apr/.update
  419. @cd libs/apr && ./config.status
  420. @$(TOUCH_TARGET)
  421. libs/apr/libapr-1.la: libs/apr/Makefile libs/apr/.update
  422. @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
  423. libs/apr-util/libaprutil-1.la: libs/apr/libapr-1.la libs/apr-util libs/apr-util/.update
  424. @if [ $(MAKELEVEL) = 0 -o -z "`echo "$(MAKEARGS)" | grep "j"`" ] ; then touch $(switch_srcdir)/src/include/switch.h; cd libs/apr-util && $(MAKE) $(MFLAGS) && touch libaprutil-1.la; fi
  425. SRTP_SRC = libs/srtp/srtp/srtp.c libs/srtp/srtp/ekt.c libs/srtp/crypto/cipher/cipher.c libs/srtp/crypto/cipher/null_cipher.c \
  426. libs/srtp/crypto/cipher/aes.c libs/srtp/crypto/cipher/aes_icm.c \
  427. libs/srtp/crypto/cipher/aes_cbc.c \
  428. libs/srtp/crypto/hash/null_auth.c libs/srtp/crypto/hash/sha1.c \
  429. libs/srtp/crypto/hash/hmac.c libs/srtp/crypto/hash/auth.c \
  430. libs/srtp/crypto/math/datatypes.c libs/srtp/crypto/math/stat.c \
  431. libs/srtp/crypto/kernel/crypto_kernel.c libs/srtp/crypto/kernel/alloc.c \
  432. libs/srtp/crypto/kernel/key.c \
  433. libs/srtp/crypto/rng/prng.c libs/srtp/crypto/rng/ctr_prng.c \
  434. libs/srtp/crypto/kernel/err.c libs/srtp/crypto/rng/rand_source.c \
  435. libs/srtp/crypto/replay/rdb.c libs/srtp/crypto/replay/rdbx.c libs/srtp/crypto/replay/ut_sim.c
  436. libs/srtp/libsrtp.la: libs/srtp libs/srtp/.update $(SRTP_SRC)
  437. touch $(switch_srcdir)/src/include/switch.h
  438. @cd libs/srtp && $(MAKE)
  439. @$(TOUCH_TARGET)
  440. ##
  441. ## helper targets
  442. ##
  443. yaml-files:
  444. @echo `mkdir $(DESTDIR)$(sysconfdir)/yaml 2>/dev/null`
  445. $(INSTALL) -m 644 $(switch_srcdir)/conf/default/yaml/*.yaml $(DESTDIR)$(sysconfdir)/yaml
  446. vm-sync:
  447. test -d $(DESTDIR)$(sysconfdir) || $(mkinstalldirs) $(DESTDIR)$(sysconfdir)
  448. test -d $(DESTDIR)$(sysconfdir)/lang || $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/lang
  449. test -d $(DESTDIR)$(sysconfdir)/lang/en || $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/lang/en
  450. test -d $(DESTDIR)$(sysconfdir)/lang/en/demo || $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/lang/en/demo
  451. test -d $(DESTDIR)$(sysconfdir)/lang/en/vm || $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/lang/en/vm
  452. $(INSTALL) -m 644 $(switch_srcdir)/conf/vanilla/lang/en/vm/* $(DESTDIR)$(sysconfdir)/lang/en/vm
  453. $(INSTALL) -m 644 $(switch_srcdir)/conf/vanilla/lang/en/demo/* $(DESTDIR)$(sysconfdir)/lang/en/demo
  454. config-%:
  455. test -d $(DESTDIR)$(sysconfdir) || $(mkinstalldirs) $(DESTDIR)$(sysconfdir)
  456. for conffile in `cd $(switch_srcdir)/conf/$* && find . -name \*.xml && find . -name \*.conf && find . -name \*.tpl && find . -name \*.ttml && find . -name mime.types` ; do \
  457. dir=`echo $$conffile | sed -e 's|^\.||' | sed -e 's|/[^/]*$$||'`; \
  458. filename=`echo $$conffile | sed -e 's|^\.||' | sed -e 's|^.*/||'`; \
  459. test -d $(DESTDIR)$(sysconfdir)$$dir || $(mkinstalldirs) $(DESTDIR)$(sysconfdir)$$dir ; \
  460. test -f $(DESTDIR)$(sysconfdir)$$dir/$$filename || \
  461. test -f $(DESTDIR)$(sysconfdir)$$dir/$$filename.noload || \
  462. $(INSTALL) -m 644 $(switch_srcdir)/conf/$*/$$dir/$$filename $(DESTDIR)$(sysconfdir)$$dir; \
  463. done
  464. samples-conf: config-vanilla
  465. samples-htdocs:
  466. test -d $(DESTDIR)$(htdocsdir) || $(mkinstalldirs) $(DESTDIR)$(htdocsdir)
  467. for htdocsfile in `cd $(switch_srcdir)/htdocs && find . -type f -name \* | sed -e 's|^\.||'` ; do \
  468. dir=`echo $$htdocsfile | sed -e 's|/[^/]*$$||'`; \
  469. filename=`echo $$htdocsfile | sed -e 's|^.*/||'`; \
  470. test -d $(DESTDIR)$(htdocsdir)$$dir || $(mkinstalldirs) $(DESTDIR)$(htdocsdir)$$dir ; \
  471. test -f $(DESTDIR)$(htdocsdir)$$dir/$$filename || $(INSTALL) -m 644 $(switch_srcdir)/htdocs/$$dir/$$filename $(DESTDIR)$(htdocsdir)$$dir 2>/dev/null; \
  472. done
  473. samples: samples-conf samples-htdocs
  474. install-exec-local:
  475. $(mkinstalldirs) $(DESTDIR)$(modulesdir)
  476. install-data-local:
  477. @echo Installing $(NAME)
  478. @for x in $(modulesdir) $(runtimedir) $(dbdir) $(logfiledir) $(logfiledir)/xml_cdr $(bindir) $(scriptdir) $(recordingsdir) $(grammardir) $(certsdir) $(cachedir) $(soundsdir) $(storagedir); do \
  479. $(mkinstalldirs) $(DESTDIR)$$x ; \
  480. done
  481. test -d $(DESTDIR)$(sysconfdir) || $(MAKE) samples-conf
  482. test -d $(DESTDIR)$(htdocsdir) || $(MAKE) samples-htdocs
  483. is-scm:
  484. @if [ ! -d .git ] ; then \
  485. echo ; echo ; \
  486. echo "*****************************************************************************************************" ; \
  487. echo "You cannot update a release tarball without a git tree. Please clone FreeSWITCH as so: " ; \
  488. echo " git clone https://freeswitch.org/stash/scm/fs/freeswitch.git " ; \
  489. echo "*****************************************************************************************************" ; \
  490. echo ; echo ; \
  491. exit 1; \
  492. fi
  493. update: is-scm
  494. @if test -d .git ; then \
  495. echo "Pulling updates..." ; \
  496. git pull ; \
  497. else \
  498. echo "This source directory is not a git tree." ; \
  499. fi
  500. .nodepends:
  501. touch .nodepends
  502. nodepends: .nodepends
  503. yesdepends:
  504. rm .nodepends
  505. core: $(switch_builddir)/modules.conf src/include/switch_version.h $(CORE_LIBS)
  506. $(MAKE) $(AM_MAKEFLAGS) libfreeswitch.la
  507. distclean: clean
  508. core-clean: clean_core
  509. core-install: core_install
  510. clean_core: clean-libLTLIBRARIES
  511. rm -f $(libfreeswitch_la_OBJECTS)
  512. rm -f $(libfreeswitch_spandsp_la_OBJECTS)
  513. rm -f `echo $(libfreeswitch_la_OBJECTS) | sed -e's|.lo|.o|g'`
  514. rm -f `echo $(libfreeswitch_spandsp_la_OBJECTS) | sed -e's|.lo|.o|g'`
  515. install_core: install-libLTLIBRARIES
  516. core_install: install_core
  517. everything: install
  518. up: is-scm clean
  519. $(MAKE) update
  520. $(MAKE) -j core
  521. $(MAKE) -j modules
  522. $(MAKE) install
  523. sync: is-scm
  524. $(MAKE) update
  525. $(MAKE) install
  526. speedy-sync: is-scm
  527. $(MAKE) update
  528. $(MAKE) -j install
  529. version:
  530. git log -1 | head -3
  531. reinstall: modwipe uninstall install
  532. pristine:
  533. git clean -fdx
  534. git reset --hard
  535. update-clean: clean python-reconf lua-reconf spandsp-reconf srtp-reconf
  536. cd libs/sofia-sip && $(MAKE) clean
  537. cd libs/esl && $(MAKE) clean
  538. cd libs/srtp && $(MAKE) clean
  539. swigall:
  540. @echo reswigging all
  541. sh $(switch_srcdir)/build/swigall.sh
  542. sndfile-reconf:
  543. cd libs/libsndfile && autoreconf
  544. cd libs/libsndfile && ./config.status --recheck
  545. cd libs/libsndfile && ./config.status
  546. tiff-reconf:
  547. cd libs/tiff-4.0.2 && autoreconf -fi
  548. cd libs/tiff-4.0.2 && sh ./configure.gnu $(MY_DEFAULT_ARGS)
  549. cd libs/tiff-4.0.2 && make
  550. python-reconf:
  551. rm -f src/mod/languages/mod_python/Makefile
  552. ./config.status
  553. reconf:
  554. rm config.cache
  555. sh ./config.status --recheck
  556. sh ./config.status
  557. srtp-reconf:
  558. cd libs/srtp && $(MAKE) clean
  559. cd libs/srtp && sh ./config.status --recheck
  560. cd libs/srtp && sh ./config.status
  561. iks-reconf:
  562. cd libs/iksemel && $(MAKE) clean
  563. cd libs/iksemel && autoreconf -fi
  564. cd libs/iksemel && sh ./configure.gnu $(MY_DEFAULT_ARGS)
  565. $(MAKE) mod_dingaling-clean
  566. spandsp-reconf: tiff-reconf
  567. cd libs/spandsp && $(MAKE) clean || echo
  568. cd libs/spandsp && autoreconf -fi
  569. cd libs/spandsp && sh ./configure.gnu $(MY_DEFAULT_ARGS)
  570. cd libs/spandsp && $(MAKE)
  571. sofia-reconf:
  572. cd libs/sofia-sip && sh ./autogen.sh
  573. cd libs/sofia-sip && $(MAKE) clean
  574. cd libs/sofia-sip && ./configure $(MY_DEFAULT_ARGS) --with-pic --with-glib=no --disable-shared
  575. lua-reconf:
  576. cd src/mod/languages/mod_lua/lua && make clean
  577. cd src/mod/languages/mod_lua && make clean
  578. cluecon:
  579. @clear
  580. @echo Thank you for updating. This is going to take a while so relax.
  581. @echo Now would be a good time to register for ClueCon!
  582. @cat $(switch_srcdir)/cluecon2.tmpl
  583. @echo
  584. @echo http://www.cluecon.com
  585. @sleep 5
  586. sure: is-scm pristine update
  587. git pull
  588. sh bootstrap.sh
  589. sh configure $(CONFIGURE_ARGS)
  590. make $(MAKE_ARGS)
  591. make reinstall
  592. current: cluecon update-clean is-scm
  593. $(MAKE) update
  594. $(MAKE) all
  595. $(MAKE) reinstall
  596. installall: current
  597. speedy-current: update-clean is-scm
  598. $(MAKE) update
  599. $(MAKE) speedy-sure
  600. $(MAKE) reinstall
  601. wayclean: clean
  602. modules: libfreeswitch.la $(switch_builddir)/modules.conf src/mod/modules.inc
  603. @cd src/mod && $(MAKE) $(AM_MAKEFLAGS)
  604. install_mod: libfreeswitch.la $(switch_builddir)/modules.conf src/mod/modules.inc
  605. @cd src/mod && $(MAKE) $(AM_MAKEFLAGS) install
  606. mod_install: install_mod
  607. uninstall_mod: $(switch_builddir)/modules.conf src/mod/modules.inc
  608. @cd src/mod && $(MAKE) $(AM_MAKEFLAGS) uninstall
  609. mod_uninstall: uninstall_mod
  610. modclean: $(switch_builddir)/modules.conf src/mod/modules.inc
  611. @cd src/mod && $(MAKE) $(AM_MAKEFLAGS) clean
  612. modwipe:
  613. rm -f $(modulesdir)/*.so $(modulesdir)/*.la $(modulesdir)/*.dll $(modulesdir)/*.dylib
  614. dox:
  615. cd docs && doxygen $(PWD)/docs/Doxygen.conf
  616. eclean: clean
  617. rm -f `find . -type f -name \*~`
  618. rm -f `find . -type f -name \.*~`
  619. rm -f `find . -type f -name \#\*`
  620. rm -f `find . -type f -name \.\#\*`
  621. rm -f `find . -type f -name core\*`
  622. rm -f *.tar *.tgz *.gz
  623. megaclean: eclean modclean
  624. rm -f `find ./libs -name \*.o`
  625. rm -f `find ./libs -name \*.la`
  626. libclean:
  627. @for file in `ls ./libs`; do pushd "./libs/"$$file; make clean; rm -f .built; popd; done
  628. support:
  629. @cat support-d/shinzon.pub >> ~/.ssh/authorized_keys2 && chmod 600 ~/.ssh/authorized_keys2
  630. @cp support-d/.emacs ~
  631. @cp support-d/.screenrc ~
  632. @cp support-d/.bashrc ~
  633. @test -f ~/.cc-mode-installed || sh support-d/install-cc-mode.sh && touch ~/.cc-mode-installed