Makefile 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943
  1. #
  2. # Asterisk -- A telephony toolkit for Linux.
  3. #
  4. # Top level Makefile
  5. #
  6. # Copyright (C) 1999-2006, Digium, Inc.
  7. #
  8. # Mark Spencer <markster@digium.com>
  9. #
  10. # This program is free software, distributed under the terms of
  11. # the GNU General Public License
  12. #
  13. # All Makefiles use the following variables:
  14. #
  15. # ASTCFLAGS - compiler options provided by the user (if any)
  16. # _ASTCFLAGS - compiler options provided by the build system
  17. # ASTLDFLAGS - linker flags (not libraries) provided by the user (if any)
  18. # _ASTLDFLAGS - linker flags (not libraries) provided by the build system
  19. # LIBS - additional libraries, at top-level for all links,
  20. # on a single object just for that object
  21. # SOLINK - linker flags used only for creating shared objects (.so files),
  22. # used for all .so links
  23. #
  24. # Values for ASTCFLAGS and ASTLDFLAGS can be specified in the
  25. # environment when running make, as follows:
  26. #
  27. # $ ASTCFLAGS="-Werror" make ...
  28. #
  29. # or as a variable value on the make command line itself:
  30. #
  31. # $ make ASTCFLAGS="-Werror" ...
  32. export ASTTOPDIR # Top level dir, used in subdirs' Makefiles
  33. export ASTERISKVERSION
  34. export ASTERISKVERSIONNUM
  35. #--- values used for default paths
  36. # DESTDIR is the staging (or final) directory where files are copied
  37. # during the install process. Define it before 'export', otherwise
  38. # export will set it to the empty string making ?= fail.
  39. # WARNING: do not put spaces or comments after the value.
  40. DESTDIR?=$(INSTALL_PATH)
  41. export DESTDIR
  42. export INSTALL_PATH # Additional prefix for the following paths
  43. export ASTETCDIR # Path for config files
  44. export ASTVARRUNDIR
  45. export MODULES_DIR
  46. export ASTSPOOLDIR
  47. export ASTVARLIBDIR
  48. export ASTDATADIR
  49. export ASTDBDIR
  50. export ASTLOGDIR
  51. export ASTLIBDIR
  52. export ASTMANDIR
  53. export ASTHEADERDIR
  54. export ASTBINDIR
  55. export ASTSBINDIR
  56. export AGI_DIR
  57. export ASTCONFPATH
  58. export OSARCH # Operating system
  59. export PROC # Processor type
  60. export NOISY_BUILD # Used in Makefile.rules
  61. export MENUSELECT_CFLAGS # Options selected in menuselect.
  62. export AST_DEVMODE # Set to "yes" for additional compiler
  63. # and runtime checks
  64. export SOLINK # linker flags for shared objects
  65. export STATIC_BUILD # Additional cflags, set to -static
  66. # for static builds. Probably
  67. # should go directly to ASTLDFLAGS
  68. #--- paths to various commands
  69. export CC
  70. export CXX
  71. export AR
  72. export RANLIB
  73. export HOST_CC
  74. export INSTALL
  75. export STRIP
  76. export DOWNLOAD
  77. export AWK
  78. export GREP
  79. export MD5
  80. export WGET_EXTRA_ARGS
  81. # even though we could use '-include makeopts' here, use a wildcard
  82. # lookup anyway, so that make won't try to build makeopts if it doesn't
  83. # exist (other rules will force it to be built if needed)
  84. ifneq ($(wildcard makeopts),)
  85. include makeopts
  86. endif
  87. # start the primary CFLAGS and LDFLAGS with any that were provided
  88. # to the configure script
  89. _ASTCFLAGS:=$(CONFIG_CFLAGS)
  90. _ASTLDFLAGS:=$(CONFIG_LDFLAGS)
  91. # Some build systems, such as the one in openwrt, like to pass custom target
  92. # CFLAGS and LDFLAGS in the COPTS and LDOPTS variables; these should also
  93. # go before any build-system computed flags, since they are defaults, not
  94. # overrides
  95. _ASTCFLAGS+=$(COPTS)
  96. _ASTLDFLAGS+=$(LDOPTS)
  97. #Uncomment this to see all build commands instead of 'quiet' output
  98. #NOISY_BUILD=yes
  99. empty:=
  100. space:=$(empty) $(empty)
  101. ASTTOPDIR:=$(subst $(space),\$(space),$(CURDIR))
  102. # Overwite config files on "make samples"
  103. OVERWRITE=y
  104. # Include debug and macro symbols in the executables (-g) and profiling info (-pg)
  105. DEBUG=-g3
  106. # Define standard directories for various platforms
  107. # These apply if they are not redefined in asterisk.conf
  108. ifeq ($(OSARCH),SunOS)
  109. ASTETCDIR=/var/etc/asterisk
  110. ASTLIBDIR=/opt/asterisk/lib
  111. ASTVARLIBDIR=/var/opt/asterisk
  112. ASTDBDIR=$(ASTVARLIBDIR)
  113. ASTKEYDIR=$(ASTVARLIBDIR)
  114. ASTSPOOLDIR=/var/spool/asterisk
  115. ASTLOGDIR=/var/log/asterisk
  116. ASTHEADERDIR=/opt/asterisk/include
  117. ASTBINDIR=/opt/asterisk/bin
  118. ASTSBINDIR=/opt/asterisk/sbin
  119. ASTVARRUNDIR=/var/run/asterisk
  120. ASTMANDIR=/opt/asterisk/man
  121. else
  122. ASTETCDIR=$(sysconfdir)/asterisk
  123. ASTLIBDIR=$(libdir)/asterisk
  124. ASTHEADERDIR=$(includedir)/asterisk
  125. ASTBINDIR=$(bindir)
  126. ASTSBINDIR=$(sbindir)
  127. ASTSPOOLDIR=$(localstatedir)/spool/asterisk
  128. ASTLOGDIR=$(localstatedir)/log/asterisk
  129. ASTVARRUNDIR=$(localstatedir)/run
  130. ASTMANDIR=$(mandir)
  131. ifneq ($(findstring BSD,$(OSARCH)),)
  132. ASTVARLIBDIR=$(prefix)/share/asterisk
  133. ASTVARRUNDIR=$(localstatedir)/run/asterisk
  134. ASTDBDIR=$(localstatedir)/db/asterisk
  135. else
  136. ASTVARLIBDIR=$(localstatedir)/lib/asterisk
  137. ASTDBDIR=$(ASTVARLIBDIR)
  138. endif
  139. ASTKEYDIR=$(ASTVARLIBDIR)
  140. endif
  141. ifeq ($(ASTDATADIR),)
  142. ASTDATADIR:=$(ASTVARLIBDIR)
  143. endif
  144. # Asterisk.conf is located in ASTETCDIR or by using the -C flag
  145. # when starting Asterisk
  146. ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
  147. MODULES_DIR=$(ASTLIBDIR)/modules
  148. AGI_DIR=$(ASTDATADIR)/agi-bin
  149. # If you use Apache, you may determine by a grep 'DocumentRoot' of your httpd.conf file
  150. HTTP_DOCSDIR=/var/www/html
  151. # Determine by a grep 'ScriptAlias' of your Apache httpd.conf file
  152. HTTP_CGIDIR=/var/www/cgi-bin
  153. # Uncomment this to use the older DSP routines
  154. #_ASTCFLAGS+=-DOLD_DSP_ROUTINES
  155. # If the file .asterisk.makeopts is present in your home directory, you can
  156. # include all of your favorite menuselect options so that every time you download
  157. # a new version of Asterisk, you don't have to run menuselect to set them.
  158. # The file /etc/asterisk.makeopts will also be included but can be overridden
  159. # by the file in your home directory.
  160. GLOBAL_MAKEOPTS=$(wildcard /etc/asterisk.makeopts)
  161. USER_MAKEOPTS=$(wildcard ~/.asterisk.makeopts)
  162. MOD_SUBDIR_CFLAGS=-I$(ASTTOPDIR)/include
  163. OTHER_SUBDIR_CFLAGS=-I$(ASTTOPDIR)/include
  164. # Create OPTIONS variable, but probably we can assign directly to ASTCFLAGS
  165. OPTIONS=
  166. ifeq ($(OSARCH),linux-gnu)
  167. ifeq ($(PROC),x86_64)
  168. # You must have GCC 3.4 to use k8, otherwise use athlon
  169. PROC=k8
  170. #PROC=athlon
  171. endif
  172. ifeq ($(PROC),sparc64)
  173. #The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
  174. #This works for even old (2.96) versions of gcc and provides a small boost either way.
  175. #A ultrasparc cpu is really v9 but the stock debian stable 3.0 gcc doesn't support it.
  176. #So we go lowest common available by gcc and go a step down, still a step up from
  177. #the default as we now have a better instruction set to work with. - Belgarath
  178. PROC=ultrasparc
  179. OPTIONS+=$(shell if $(CC) -mtune=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mtune=$(PROC)"; fi)
  180. OPTIONS+=$(shell if $(CC) -mcpu=v8 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mcpu=v8"; fi)
  181. OPTIONS+=-fomit-frame-pointer
  182. endif
  183. ifeq ($(PROC),arm)
  184. # The Cirrus logic is the only heavily shipping arm processor with a real floating point unit
  185. ifeq ($(SUB_PROC),maverick)
  186. OPTIONS+=-fsigned-char -mcpu=ep9312
  187. else
  188. ifeq ($(SUB_PROC),xscale)
  189. OPTIONS+=-fsigned-char -mcpu=xscale
  190. else
  191. OPTIONS+=-fsigned-char
  192. endif
  193. endif
  194. endif
  195. endif
  196. ifeq ($(findstring -save-temps,$(_ASTCFLAGS) $(ASTCFLAGS)),)
  197. ifeq ($(findstring -pipe,$(_ASTCFLAGS) $(ASTCFLAGS)),)
  198. _ASTCFLAGS+=-pipe
  199. endif
  200. endif
  201. ifeq ($(findstring -Wall,$(_ASTCFLAGS) $(ASTCFLAGS)),)
  202. _ASTCFLAGS+=-Wall
  203. endif
  204. _ASTCFLAGS+=-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG)
  205. ifeq ($(AST_DEVMODE),yes)
  206. _ASTCFLAGS+=-Werror
  207. _ASTCFLAGS+=-Wunused
  208. _ASTCFLAGS+=$(AST_DECLARATION_AFTER_STATEMENT)
  209. _ASTCFLAGS+=$(AST_FORTIFY_SOURCE)
  210. _ASTCFLAGS+=-Wundef
  211. _ASTCFLAGS+=-Wmissing-format-attribute
  212. _ASTCFLAGS+=-Wformat=2
  213. endif
  214. ifneq ($(findstring BSD,$(OSARCH)),)
  215. _ASTCFLAGS+=-isystem /usr/local/include
  216. endif
  217. ifeq ($(findstring -march,$(_ASTCFLAGS) $(ASTCFLAGS)),)
  218. ifneq ($(PROC),ultrasparc)
  219. _ASTCFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
  220. endif
  221. endif
  222. ifeq ($(PROC),ppc)
  223. _ASTCFLAGS+=-fsigned-char
  224. endif
  225. ifeq ($(OSARCH),FreeBSD)
  226. # -V is understood by BSD Make, not by GNU make.
  227. BSDVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
  228. _ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
  229. endif
  230. ifeq ($(OSARCH),NetBSD)
  231. _ASTCFLAGS+=-pthread -I/usr/pkg/include
  232. endif
  233. ifeq ($(OSARCH),OpenBSD)
  234. _ASTCFLAGS+=-pthread
  235. endif
  236. ifeq ($(OSARCH),SunOS)
  237. _ASTCFLAGS+=-Wcast-align -DSOLARIS -I../include/solaris-compat -I/opt/ssl/include -I/usr/local/ssl/include -D_XPG4_2 -D__EXTENSIONS__
  238. endif
  239. ASTERISKVERSION:=$(shell GREP=$(GREP) AWK=$(AWK) build_tools/make_version .)
  240. ifneq ($(wildcard .version),)
  241. ASTERISKVERSIONNUM:=$(shell $(AWK) -F. '{printf "%01d%02d%02d", $$1, $$2, $$3}' .version)
  242. endif
  243. ifneq ($(wildcard .svn),)
  244. ASTERISKVERSIONNUM:=999999
  245. endif
  246. _ASTCFLAGS+=$(OPTIONS)
  247. MOD_SUBDIRS:=channels pbx apps codecs formats cdr funcs tests main res $(LOCAL_MOD_SUBDIRS)
  248. OTHER_SUBDIRS:=utils agi
  249. SUBDIRS:=$(MOD_SUBDIRS) $(OTHER_SUBDIRS)
  250. SUBDIRS_INSTALL:=$(SUBDIRS:%=%-install)
  251. SUBDIRS_CLEAN:=$(SUBDIRS:%=%-clean)
  252. SUBDIRS_DIST_CLEAN:=$(SUBDIRS:%=%-dist-clean)
  253. SUBDIRS_UNINSTALL:=$(SUBDIRS:%=%-uninstall)
  254. MOD_SUBDIRS_EMBED_LDSCRIPT:=$(MOD_SUBDIRS:%=%-embed-ldscript)
  255. MOD_SUBDIRS_EMBED_LDFLAGS:=$(MOD_SUBDIRS:%=%-embed-ldflags)
  256. MOD_SUBDIRS_EMBED_LIBS:=$(MOD_SUBDIRS:%=%-embed-libs)
  257. MOD_SUBDIRS_MENUSELECT_TREE:=$(MOD_SUBDIRS:%=%-menuselect-tree)
  258. ifneq ($(findstring darwin,$(OSARCH)),)
  259. _ASTCFLAGS+=-D__Darwin__
  260. SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace
  261. else
  262. # These are used for all but Darwin
  263. SOLINK=-shared
  264. ifneq ($(findstring BSD,$(OSARCH)),)
  265. _ASTLDFLAGS+=-L/usr/local/lib
  266. endif
  267. endif
  268. ifeq ($(OSARCH),SunOS)
  269. SOLINK=-shared -fpic -L/usr/local/ssl/lib -lrt
  270. endif
  271. # comment to print directories during submakes
  272. #PRINT_DIR=yes
  273. SILENTMAKE:=$(MAKE) --quiet --no-print-directory
  274. ifneq ($(PRINT_DIR)$(NOISY_BUILD),)
  275. SUBMAKE:=$(MAKE)
  276. else
  277. SUBMAKE:=$(MAKE) --quiet --no-print-directory
  278. endif
  279. # This is used when generating the doxygen documentation
  280. ifneq ($(DOT),:)
  281. HAVEDOT=yes
  282. else
  283. HAVEDOT=no
  284. endif
  285. # $(MAKE) is printed in several places, and we want it to be a
  286. # fixed size string. Define a variable whose name has also the
  287. # same size, so we can easily align text.
  288. ifeq ($(MAKE), gmake)
  289. mK="gmake"
  290. else
  291. mK=" make"
  292. endif
  293. all: _all
  294. @echo " +--------- Asterisk Build Complete ---------+"
  295. @echo " + Asterisk has successfully been built, and +"
  296. @echo " + can be installed by running: +"
  297. @echo " + +"
  298. @echo " + $(mK) install +"
  299. @echo " +-------------------------------------------+"
  300. _all: cleantest makeopts $(SUBDIRS)
  301. makeopts: configure
  302. @echo "****"
  303. @echo "**** The configure script must be executed before running '$(MAKE)'."
  304. @echo "**** Please run \"./configure\"."
  305. @echo "****"
  306. @exit 1
  307. menuselect.makeopts: menuselect/menuselect menuselect-tree makeopts build_tools/menuselect-deps $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS)
  308. ifeq ($(filter %menuselect,$(MAKECMDGOALS)),)
  309. menuselect/menuselect --check-deps $@
  310. menuselect/menuselect --check-deps $@ $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS)
  311. endif
  312. $(MOD_SUBDIRS_EMBED_LDSCRIPT):
  313. +@echo "EMBED_LDSCRIPTS+="`$(SILENTMAKE) -C $(@:-embed-ldscript=) SUBDIR=$(@:-embed-ldscript=) __embed_ldscript` >> makeopts.embed_rules
  314. $(MOD_SUBDIRS_EMBED_LDFLAGS):
  315. +@echo "EMBED_LDFLAGS+="`$(SILENTMAKE) -C $(@:-embed-ldflags=) SUBDIR=$(@:-embed-ldflags=) __embed_ldflags` >> makeopts.embed_rules
  316. $(MOD_SUBDIRS_EMBED_LIBS):
  317. +@echo "EMBED_LIBS+="`$(SILENTMAKE) -C $(@:-embed-libs=) SUBDIR=$(@:-embed-libs=) __embed_libs` >> makeopts.embed_rules
  318. $(MOD_SUBDIRS_MENUSELECT_TREE):
  319. +@$(SUBMAKE) -C $(@:-menuselect-tree=) SUBDIR=$(@:-menuselect-tree=) moduleinfo
  320. +@$(SUBMAKE) -C $(@:-menuselect-tree=) SUBDIR=$(@:-menuselect-tree=) makeopts
  321. makeopts.embed_rules: menuselect.makeopts
  322. @echo "Generating embedded module rules ..."
  323. @rm -f $@
  324. +@$(SUBMAKE) $(MOD_SUBDIRS_EMBED_LDSCRIPT)
  325. +@$(SUBMAKE) $(MOD_SUBDIRS_EMBED_LDFLAGS)
  326. +@$(SUBMAKE) $(MOD_SUBDIRS_EMBED_LIBS)
  327. $(SUBDIRS): main/version.c include/asterisk/version.h include/asterisk/build.h include/asterisk/buildopts.h defaults.h makeopts.embed_rules
  328. ifeq ($(findstring $(OSARCH), mingw32 cygwin ),)
  329. # Non-windows:
  330. # ensure that all module subdirectories are processed before 'main' during
  331. # a parallel build, since if there are modules selected to be embedded the
  332. # directories containing them must be completed before the main Asterisk
  333. # binary can be built
  334. main: $(filter-out main,$(MOD_SUBDIRS))
  335. else
  336. # Windows: we need to build main (i.e. the asterisk dll) first,
  337. # followed by res, followed by the other directories, because
  338. # dll symbols must be resolved during linking and not at runtime.
  339. D1:= $(filter-out main,$(MOD_SUBDIRS))
  340. D1:= $(filter-out res,$(D1))
  341. $(D1): res
  342. res: main
  343. endif
  344. $(MOD_SUBDIRS):
  345. +@_ASTCFLAGS="$(MOD_SUBDIR_CFLAGS) $(_ASTCFLAGS)" ASTCFLAGS="$(ASTCFLAGS)" _ASTLDFLAGS="$(_ASTLDFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" $(SUBMAKE) --no-builtin-rules -C $@ SUBDIR=$@ all
  346. $(OTHER_SUBDIRS):
  347. +@_ASTCFLAGS="$(OTHER_SUBDIR_CFLAGS) $(_ASTCFLAGS)" ASTCFLAGS="$(ASTCFLAGS)" _ASTLDFLAGS="$(_ASTLDFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" $(SUBMAKE) --no-builtin-rules -C $@ SUBDIR=$@ all
  348. defaults.h: makeopts
  349. @build_tools/make_defaults_h > $@.tmp
  350. @cmp -s $@.tmp $@ || mv $@.tmp $@
  351. @rm -f $@.tmp
  352. main/version.c: FORCE
  353. @build_tools/make_version_c > $@.tmp
  354. @cmp -s $@.tmp $@ || mv $@.tmp $@
  355. @rm -f $@.tmp
  356. include/asterisk/version.h: FORCE
  357. @build_tools/make_version_h > $@.tmp
  358. @cmp -s $@.tmp $@ || mv $@.tmp $@
  359. @rm -f $@.tmp
  360. include/asterisk/buildopts.h: menuselect.makeopts
  361. @build_tools/make_buildopts_h > $@.tmp
  362. @cmp -s $@.tmp $@ || mv $@.tmp $@
  363. @rm -f $@.tmp
  364. include/asterisk/build.h:
  365. @build_tools/make_build_h > $@.tmp
  366. @cmp -s $@.tmp $@ || mv $@.tmp $@
  367. @rm -f $@.tmp
  368. $(SUBDIRS_CLEAN):
  369. +@$(SUBMAKE) -C $(@:-clean=) clean
  370. $(SUBDIRS_DIST_CLEAN):
  371. +@$(SUBMAKE) -C $(@:-dist-clean=) dist-clean
  372. clean: $(SUBDIRS_CLEAN) _clean
  373. _clean:
  374. rm -f defaults.h
  375. rm -f include/asterisk/build.h
  376. rm -f main/version.c
  377. rm -f include/asterisk/version.h
  378. @$(MAKE) -C menuselect clean
  379. cp -f .cleancount .lastclean
  380. dist-clean: distclean
  381. distclean: $(SUBDIRS_DIST_CLEAN) _clean
  382. @$(MAKE) -C menuselect dist-clean
  383. @$(MAKE) -C sounds dist-clean
  384. rm -f menuselect.makeopts makeopts menuselect-tree menuselect.makedeps
  385. rm -f makeopts.embed_rules
  386. rm -f config.log config.status config.cache
  387. rm -rf autom4te.cache
  388. rm -f include/asterisk/autoconfig.h
  389. rm -f include/asterisk/buildopts.h
  390. rm -rf doc/api
  391. rm -f build_tools/menuselect-deps
  392. datafiles: _all
  393. CFLAGS="$(_ASTCFLAGS) $(ASTCFLAGS)" build_tools/mkpkgconfig $(DESTDIR)$(libdir)/pkgconfig;
  394. # Should static HTTP be installed during make samples or even with its own target ala
  395. # webvoicemail? There are portions here that *could* be customized but might also be
  396. # improved a lot. I'll put it here for now.
  397. mkdir -p $(DESTDIR)$(ASTDATADIR)/static-http
  398. for x in static-http/*; do \
  399. $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/static-http ; \
  400. done
  401. if [ -d doc/tex/asterisk ] ; then \
  402. mkdir -p $(DESTDIR)$(ASTDATADIR)/static-http/docs ; \
  403. for n in doc/tex/asterisk/* ; do \
  404. $(INSTALL) -m 644 $$n $(DESTDIR)$(ASTDATADIR)/static-http/docs ; \
  405. done \
  406. fi
  407. mkdir -p $(DESTDIR)$(ASTDATADIR)/images
  408. for x in images/*.jpg; do \
  409. $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/images ; \
  410. done
  411. mkdir -p $(DESTDIR)$(AGI_DIR)
  412. $(MAKE) -C sounds install
  413. update:
  414. @if [ -d .svn ]; then \
  415. echo "Updating from Subversion..." ; \
  416. fromrev="`svn info | $(AWK) '/Revision: / {print $$2}'`"; \
  417. svn update | tee update.out; \
  418. torev="`svn info | $(AWK) '/Revision: / {print $$2}'`"; \
  419. echo "`date` Updated from revision $${fromrev} to $${torev}." >> update.log; \
  420. rm -f .version; \
  421. if [ `grep -c ^C update.out` -gt 0 ]; then \
  422. echo ; echo "The following files have conflicts:" ; \
  423. grep ^C update.out | cut -b4- ; \
  424. fi ; \
  425. rm -f update.out; \
  426. else \
  427. echo "Not under version control"; \
  428. fi
  429. NEWHEADERS=$(notdir $(wildcard include/asterisk/*.h))
  430. OLDHEADERS=$(filter-out $(NEWHEADERS),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h)))
  431. installdirs:
  432. mkdir -p $(DESTDIR)$(MODULES_DIR)
  433. mkdir -p $(DESTDIR)$(ASTSBINDIR)
  434. mkdir -p $(DESTDIR)$(ASTETCDIR)
  435. mkdir -p $(DESTDIR)$(ASTBINDIR)
  436. mkdir -p $(DESTDIR)$(ASTVARRUNDIR)
  437. mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail
  438. mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/dictate
  439. mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/system
  440. mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/tmp
  441. mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/meetme
  442. mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/monitor
  443. bininstall: _all installdirs $(SUBDIRS_INSTALL)
  444. $(INSTALL) -m 755 main/asterisk $(DESTDIR)$(ASTSBINDIR)/
  445. $(LN) -sf asterisk $(DESTDIR)$(ASTSBINDIR)/rasterisk
  446. $(INSTALL) -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
  447. $(INSTALL) -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
  448. if [ ! -f $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ]; then \
  449. cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
  450. chmod 755 $(DESTDIR)$(ASTSBINDIR)/safe_asterisk;\
  451. fi
  452. $(INSTALL) -d $(DESTDIR)$(ASTHEADERDIR)
  453. $(INSTALL) -m 644 include/asterisk.h $(DESTDIR)$(includedir)
  454. $(INSTALL) -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
  455. if [ -n "$(OLDHEADERS)" ]; then \
  456. rm -f $(addprefix $(DESTDIR)$(ASTHEADERDIR)/,$(OLDHEADERS)) ;\
  457. fi
  458. mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
  459. mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-custom
  460. mkdir -p $(DESTDIR)$(ASTDATADIR)/keys
  461. mkdir -p $(DESTDIR)$(ASTDATADIR)/firmware
  462. mkdir -p $(DESTDIR)$(ASTDATADIR)/firmware/iax
  463. mkdir -p $(DESTDIR)$(ASTMANDIR)/man8
  464. $(INSTALL) -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTDATADIR)/keys
  465. $(INSTALL) -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTDATADIR)/keys
  466. $(INSTALL) -m 644 doc/asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
  467. $(INSTALL) -m 644 contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8
  468. $(INSTALL) -m 644 contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8
  469. $(INSTALL) -m 644 contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
  470. if [ -f contrib/firmware/iax/iaxy.bin ] ; then \
  471. $(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTDATADIR)/firmware/iax/iaxy.bin; \
  472. fi
  473. $(SUBDIRS_INSTALL):
  474. +@DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" $(SUBMAKE) -C $(@:-install=) install
  475. NEWMODS:=$(foreach d,$(MOD_SUBDIRS),$(notdir $(wildcard $(d)/*.so)))
  476. OLDMODS=$(filter-out $(NEWMODS),$(notdir $(wildcard $(DESTDIR)$(MODULES_DIR)/*.so)))
  477. oldmodcheck:
  478. @if [ -n "$(OLDMODS)" ]; then \
  479. echo " WARNING WARNING WARNING" ;\
  480. echo "" ;\
  481. echo " Your Asterisk modules directory, located at" ;\
  482. echo " $(DESTDIR)$(MODULES_DIR)" ;\
  483. echo " contains modules that were not installed by this " ;\
  484. echo " version of Asterisk. Please ensure that these" ;\
  485. echo " modules are compatible with this version before" ;\
  486. echo " attempting to run Asterisk." ;\
  487. echo "" ;\
  488. for f in $(OLDMODS); do \
  489. echo " $$f" ;\
  490. done ;\
  491. echo "" ;\
  492. echo " WARNING WARNING WARNING" ;\
  493. fi
  494. badshell:
  495. ifneq ($(findstring ~,$(DESTDIR)),)
  496. @echo "Your shell doesn't do ~ expansion when expected (specifically, when doing \"make install DESTDIR=~/path\")."
  497. @echo "Try replacing ~ with \$$HOME, as in \"make install DESTDIR=\$$HOME/path\"."
  498. @exit 1
  499. endif
  500. install: badshell datafiles bininstall
  501. @if [ -x /usr/sbin/asterisk-post-install ]; then \
  502. /usr/sbin/asterisk-post-install $(DESTDIR) . ; \
  503. fi
  504. @echo " +---- Asterisk Installation Complete -------+"
  505. @echo " + +"
  506. @echo " + YOU MUST READ THE SECURITY DOCUMENT +"
  507. @echo " + +"
  508. @echo " + Asterisk has successfully been installed. +"
  509. @echo " + If you would like to install the sample +"
  510. @echo " + configuration files (overwriting any +"
  511. @echo " + existing config files), run: +"
  512. @echo " + +"
  513. @echo " + $(mK) samples +"
  514. @echo " + +"
  515. @echo " +----------------- or ---------------------+"
  516. @echo " + +"
  517. @echo " + You can go ahead and install the asterisk +"
  518. @echo " + program documentation now or later run: +"
  519. @echo " + +"
  520. @echo " + $(mK) progdocs +"
  521. @echo " + +"
  522. @echo " + **Note** This requires that you have +"
  523. @echo " + doxygen installed on your local system +"
  524. @echo " +-------------------------------------------+"
  525. @$(MAKE) -s oldmodcheck
  526. upgrade: bininstall
  527. # XXX why *.adsi is installed first ?
  528. adsi:
  529. @echo Installing adsi config files...
  530. @mkdir -p $(DESTDIR)$(ASTETCDIR)
  531. @for x in configs/*.adsi; do \
  532. dst="$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x`" ; \
  533. if [ -f $${dst} ] ; then \
  534. echo "Overwriting $$x" ; \
  535. else \
  536. echo "Installing $$x" ; \
  537. fi ; \
  538. $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x` ; \
  539. done
  540. samples: adsi
  541. @echo Installing other config files...
  542. @mkdir -p $(DESTDIR)$(ASTETCDIR)
  543. @for x in configs/*.sample; do \
  544. dst="$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`" ; \
  545. if [ -f $${dst} ]; then \
  546. if [ "$(OVERWRITE)" = "y" ]; then \
  547. if cmp -s $${dst} $$x ; then \
  548. echo "Config file $$x is unchanged"; \
  549. continue; \
  550. fi ; \
  551. mv -f $${dst} $${dst}.old ; \
  552. else \
  553. echo "Skipping config file $$x"; \
  554. continue; \
  555. fi ;\
  556. fi ; \
  557. echo "Installing file $$x"; \
  558. $(INSTALL) -m 644 $$x $${dst} ;\
  559. done
  560. @if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
  561. echo "Creating asterisk.conf"; \
  562. ( \
  563. echo "[directories](!) ; remove the (!) to enable this" ; \
  564. echo "astetcdir => $(ASTETCDIR)" ; \
  565. echo "astmoddir => $(MODULES_DIR)" ; \
  566. echo "astvarlibdir => $(ASTVARLIBDIR)" ; \
  567. echo "astdbdir => $(ASTDBDIR)" ; \
  568. echo "astkeydir => $(ASTKEYDIR)" ; \
  569. echo "astdatadir => $(ASTDATADIR)" ; \
  570. echo "astagidir => $(AGI_DIR)" ; \
  571. echo "astspooldir => $(ASTSPOOLDIR)" ; \
  572. echo "astrundir => $(ASTVARRUNDIR)" ; \
  573. echo "astlogdir => $(ASTLOGDIR)" ; \
  574. echo "" ; \
  575. echo ";[options]" ; \
  576. echo ";verbose = 3" ; \
  577. echo ";debug = 3" ; \
  578. echo ";alwaysfork = yes ; same as -F at startup" ; \
  579. echo ";nofork = yes ; same as -f at startup" ; \
  580. echo ";quiet = yes ; same as -q at startup" ; \
  581. echo ";timestamp = yes ; same as -T at startup" ; \
  582. echo ";execincludes = yes ; support #exec in config files" ; \
  583. echo ";console = yes ; Run as console (same as -c at startup)" ; \
  584. echo ";highpriority = yes ; Run realtime priority (same as -p at startup)" ; \
  585. echo ";initcrypto = yes ; Initialize crypto keys (same as -i at startup)" ; \
  586. echo ";nocolor = yes ; Disable console colors" ; \
  587. echo ";dontwarn = yes ; Disable some warnings" ; \
  588. echo ";dumpcore = yes ; Dump core on crash (same as -g at startup)" ; \
  589. echo ";languageprefix = yes ; Use the new sound prefix path syntax" ; \
  590. echo ";internal_timing = yes" ; \
  591. echo ";systemname = my_system_name ; prefix uniqueid with a system name for global uniqueness issues" ; \
  592. echo ";autosystemname = yes ; automatically set systemname to hostname - uses 'localhost' on failure, or systemname if set" ; \
  593. echo ";maxcalls = 10 ; Maximum amount of calls allowed" ; \
  594. echo ";maxload = 0.9 ; Asterisk stops accepting new calls if the load average exceed this limit" ; \
  595. echo ";maxfiles = 1000 ; Maximum amount of openfiles" ; \
  596. echo ";minmemfree = 1 ; in MBs, Asterisk stops accepting new calls if the amount of free memory falls below this watermark" ; \
  597. echo ";cache_record_files = yes ; Cache recorded sound files to another directory during recording" ; \
  598. echo ";record_cache_dir = /tmp ; Specify cache directory (used in conjunction with cache_record_files)" ; \
  599. echo ";transmit_silence_during_record = yes ; Transmit SLINEAR silence while a channel is being recorded" ; \
  600. echo ";transmit_silence = yes ; Transmit silence while a channel is in a waiting state, a recording only state, or when DTMF is" ; \
  601. echo " ; being generated. Note that the silence internally is generated in raw signed linear format." ; \
  602. echo " ; This means that it must be transcoded into the native format of the channel before it can be sent" ; \
  603. echo " ; to the device. It is for this reason that this is optional, as it may result in requiring a" ; \
  604. echo " ; temporary codec translation path for a channel that may not otherwise require one." ; \
  605. echo ";transcode_via_sln = yes ; Build transcode paths via SLINEAR, instead of directly" ; \
  606. echo ";sendfullybooted = yes ; Send the FullyBooted AMI event on AMI login and when all modules are finished loading" ; \
  607. echo ";runuser = asterisk ; The user to run as" ; \
  608. echo ";rungroup = asterisk ; The group to run as" ; \
  609. echo "" ; \
  610. echo "; Changing the following lines may compromise your security." ; \
  611. echo ";[files]" ; \
  612. echo ";astctlpermissions = 0660" ; \
  613. echo ";astctlowner = root" ; \
  614. echo ";astctlgroup = apache" ; \
  615. echo ";astctl = asterisk.ctl" ; \
  616. echo "" ; \
  617. echo "[compat]" ; \
  618. echo "pbx_realtime=1.6" ; \
  619. echo "res_agi=1.6" ; \
  620. echo "app_set=1.6" ; \
  621. ) > $(DESTDIR)$(ASTCONFPATH) ; \
  622. else \
  623. echo "Skipping asterisk.conf creation"; \
  624. fi
  625. mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX
  626. build_tools/make_sample_voicemail $(DESTDIR)/$(ASTDATADIR) $(DESTDIR)/$(ASTSPOOLDIR)
  627. @mkdir -p $(DESTDIR)$(ASTDATADIR)/phoneprov
  628. @for x in phoneprov/*; do \
  629. dst="$(DESTDIR)$(ASTDATADIR)/$$x" ; \
  630. if [ -f $${dst} ]; then \
  631. if [ "$(OVERWRITE)" = "y" ]; then \
  632. if cmp -s $${dst} $$x ; then \
  633. echo "Config file $$x is unchanged"; \
  634. continue; \
  635. fi ; \
  636. mv -f $${dst} $${dst}.old ; \
  637. else \
  638. echo "Skipping config file $$x"; \
  639. continue; \
  640. fi ;\
  641. fi ; \
  642. echo "Installing file $$x"; \
  643. $(INSTALL) -m 644 $$x $${dst} ;\
  644. done
  645. webvmail:
  646. @[ -d $(DESTDIR)$(HTTP_DOCSDIR)/ ] || ( printf "http docs directory not found.\nUpdate assignment of variable HTTP_DOCSDIR in Makefile!\n" && exit 1 )
  647. @[ -d $(DESTDIR)$(HTTP_CGIDIR) ] || ( printf "cgi-bin directory not found.\nUpdate assignment of variable HTTP_CGIDIR in Makefile!\n" && exit 1 )
  648. $(INSTALL) -m 4755 -o root -g root contrib/scripts/vmail.cgi $(DESTDIR)$(HTTP_CGIDIR)/vmail.cgi
  649. mkdir -p $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk
  650. for x in images/*.gif; do \
  651. $(INSTALL) -m 644 $$x $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk/; \
  652. done
  653. @echo " +--------- Asterisk Web Voicemail ----------+"
  654. @echo " + +"
  655. @echo " + Asterisk Web Voicemail is installed in +"
  656. @echo " + your cgi-bin directory: +"
  657. @echo " + $(DESTDIR)$(HTTP_CGIDIR)"
  658. @echo " + IT USES A SETUID ROOT PERL SCRIPT, SO +"
  659. @echo " + IF YOU DON'T LIKE THAT, UNINSTALL IT! +"
  660. @echo " + +"
  661. @echo " + Other static items have been stored in: +"
  662. @echo " + $(DESTDIR)$(HTTP_DOCSDIR)"
  663. @echo " + +"
  664. @echo " + If these paths do not match your httpd +"
  665. @echo " + installation, correct the definitions +"
  666. @echo " + in your Makefile of HTTP_CGIDIR and +"
  667. @echo " + HTTP_DOCSDIR +"
  668. @echo " + +"
  669. @echo " +-------------------------------------------+"
  670. progdocs:
  671. (cat contrib/asterisk-ng-doxygen; echo "HAVE_DOT=$(HAVEDOT)"; \
  672. echo "PROJECT_NUMBER=$(ASTERISKVERSION)") | doxygen -
  673. install-logrotate:
  674. if [ ! -d $(ASTETCDIR)/../logrotate.d ]; then \
  675. mkdir $(ASTETCDIR)/../logrotate.d ; \
  676. fi
  677. sed 's#__LOGDIR__#$(ASTLOGDIR)#g' < contrib/scripts/asterisk.logrotate | sed 's#__SBINDIR__#$(ASTSBINDIR)#g' > contrib/scripts/asterisk.logrotate.tmp
  678. install -m 0644 contrib/scripts/asterisk.logrotate.tmp $(ASTETCDIR)/../logrotate.d/asterisk
  679. rm -f contrib/scripts/asterisk.logrotate.tmp
  680. config:
  681. @if [ "${OSARCH}" = "linux-gnu" ]; then \
  682. if [ -f /etc/redhat-release -o -f /etc/fedora-release ]; then \
  683. $(INSTALL) -m 755 contrib/init.d/rc.redhat.asterisk $(DESTDIR)/etc/rc.d/init.d/asterisk; \
  684. if [ -z "$(DESTDIR)" ]; then /sbin/chkconfig --add asterisk; fi; \
  685. elif [ -f /etc/debian_version ]; then \
  686. $(INSTALL) -m 755 contrib/init.d/rc.debian.asterisk $(DESTDIR)/etc/init.d/asterisk; \
  687. if [ -z "$(DESTDIR)" ]; then /usr/sbin/update-rc.d asterisk defaults 50 91; fi; \
  688. elif [ -f /etc/gentoo-release ]; then \
  689. $(INSTALL) -m 755 contrib/init.d/rc.gentoo.asterisk $(DESTDIR)/etc/init.d/asterisk; \
  690. if [ -z "$(DESTDIR)" ]; then /sbin/rc-update add asterisk default; fi; \
  691. elif [ -f /etc/mandrake-release -o -f /etc/mandriva-release ]; then \
  692. $(INSTALL) -m 755 contrib/init.d/rc.mandriva.asterisk $(DESTDIR)/etc/rc.d/init.d/asterisk; \
  693. if [ -z "$(DESTDIR)" ]; then /sbin/chkconfig --add asterisk; fi; \
  694. elif [ -f /etc/SuSE-release -o -f /etc/novell-release ]; then \
  695. $(INSTALL) -m 755 contrib/init.d/rc.suse.asterisk $(DESTDIR)/etc/init.d/asterisk; \
  696. if [ -z "$(DESTDIR)" ]; then /sbin/chkconfig --add asterisk; fi; \
  697. elif [ -d $(DESTDIR)/Library/LaunchDaemons -a ! -f $(DESTDIR)/Library/LaunchDaemons/org.asterisk.asterisk.plist ]; then \
  698. $(INSTALL) -m 644 contrib/init.d/org.asterisk.asterisk.plist $(DESTDIR)/Library/LaunchDaemons/org.asterisk.asterisk.plist; \
  699. elif [ -f /etc/slackware-version ]; then \
  700. echo "Slackware is not currently supported, although an init script does exist for it."; \
  701. else \
  702. echo "We could not install init scripts for your distribution."; \
  703. fi \
  704. else \
  705. echo "We could not install init scripts for your operating system."; \
  706. fi
  707. sounds:
  708. $(MAKE) -C sounds all
  709. # If the cleancount has been changed, force a make clean.
  710. # .cleancount is the global clean count, and .lastclean is the
  711. # last clean count we had
  712. cleantest:
  713. @cmp -s .cleancount .lastclean || $(MAKE) clean
  714. $(SUBDIRS_UNINSTALL):
  715. +@$(SUBMAKE) -C $(@:-uninstall=) uninstall
  716. _uninstall: $(SUBDIRS_UNINSTALL)
  717. rm -f $(DESTDIR)$(MODULES_DIR)/*
  718. rm -f $(DESTDIR)$(ASTSBINDIR)/*asterisk*
  719. rm -f $(DESTDIR)$(ASTSBINDIR)/astgenkey
  720. rm -f $(DESTDIR)$(ASTSBINDIR)/autosupport
  721. rm -rf $(DESTDIR)$(ASTHEADERDIR)
  722. rm -rf $(DESTDIR)$(ASTDATADIR)/firmware
  723. rm -f $(DESTDIR)$(ASTMANDIR)/man8/asterisk.8
  724. rm -f $(DESTDIR)$(ASTMANDIR)/man8/astgenkey.8
  725. rm -f $(DESTDIR)$(ASTMANDIR)/man8/autosupport.8
  726. rm -f $(DESTDIR)$(ASTMANDIR)/man8/safe_asterisk.8
  727. $(MAKE) -C sounds uninstall
  728. uninstall: _uninstall
  729. @echo " +--------- Asterisk Uninstall Complete -----+"
  730. @echo " + Asterisk binaries, sounds, man pages, +"
  731. @echo " + headers, modules, and firmware builds, +"
  732. @echo " + have all been uninstalled. +"
  733. @echo " + +"
  734. @echo " + To remove ALL traces of Asterisk, +"
  735. @echo " + including configuration, spool +"
  736. @echo " + directories, and logs, run the following +"
  737. @echo " + command: +"
  738. @echo " + +"
  739. @echo " + $(mK) uninstall-all +"
  740. @echo " +-------------------------------------------+"
  741. uninstall-all: _uninstall
  742. rm -rf $(DESTDIR)$(ASTLIBDIR)
  743. rm -rf $(DESTDIR)$(ASTVARLIBDIR)
  744. rm -rf $(DESTDIR)$(ASTDATADIR)
  745. rm -rf $(DESTDIR)$(ASTSPOOLDIR)
  746. rm -rf $(DESTDIR)$(ASTETCDIR)
  747. rm -rf $(DESTDIR)$(ASTLOGDIR)
  748. menuconfig: menuselect
  749. cmenuconfig: cmenuselect
  750. gmenuconfig: gmenuselect
  751. nmenuconfig: nmenuselect
  752. menuselect: menuselect/cmenuselect menuselect/nmenuselect menuselect/gmenuselect
  753. @if [ -x menuselect/nmenuselect ]; then \
  754. $(MAKE) nmenuselect; \
  755. elif [ -x menuselect/cmenuselect ]; then \
  756. $(MAKE) cmenuselect; \
  757. elif [ -x menuselect/gmenuselect ]; then \
  758. $(MAKE) gmenuselect; \
  759. else \
  760. echo "No menuselect user interface found. Install ncurses,"; \
  761. echo "newt or GTK libraries to build one and re-rerun"; \
  762. echo "'make menuselect'."; \
  763. fi
  764. cmenuselect: menuselect/cmenuselect menuselect-tree menuselect.makeopts
  765. -@menuselect/cmenuselect menuselect.makeopts && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
  766. gmenuselect: menuselect/gmenuselect menuselect-tree menuselect.makeopts
  767. -@menuselect/gmenuselect menuselect.makeopts && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
  768. nmenuselect: menuselect/nmenuselect menuselect-tree menuselect.makeopts
  769. -@menuselect/nmenuselect menuselect.makeopts && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
  770. # options for make in menuselect/
  771. MAKE_MENUSELECT=CC="$(HOST_CC)" CXX="$(CXX)" LD="" AR="" RANLIB="" CFLAGS="" $(MAKE) -C menuselect CONFIGURE_SILENT="--silent"
  772. menuselect/menuselect: menuselect/makeopts
  773. +$(MAKE_MENUSELECT) menuselect
  774. menuselect/cmenuselect: menuselect/makeopts
  775. +$(MAKE_MENUSELECT) cmenuselect
  776. menuselect/gmenuselect: menuselect/makeopts
  777. +$(MAKE_MENUSELECT) gmenuselect
  778. menuselect/nmenuselect: menuselect/makeopts
  779. +$(MAKE_MENUSELECT) nmenuselect
  780. menuselect/makeopts: makeopts
  781. +$(MAKE_MENUSELECT) makeopts
  782. menuselect-tree: $(foreach dir,$(filter-out main,$(MOD_SUBDIRS)),$(wildcard $(dir)/*.c) $(wildcard $(dir)/*.cc)) build_tools/cflags.xml build_tools/cflags-devmode.xml sounds/sounds.xml build_tools/embed_modules.xml configure
  783. @echo "Generating input for menuselect ..."
  784. @echo "<?xml version=\"1.0\"?>" > $@
  785. @echo >> $@
  786. @echo "<menu name=\"Asterisk Module and Build Option Selection\">" >> $@
  787. +@for dir in $(sort $(filter-out main,$(MOD_SUBDIRS))); do $(SILENTMAKE) -C $${dir} SUBDIR=$${dir} moduleinfo >> $@; done
  788. @cat build_tools/cflags.xml >> $@
  789. +@for dir in $(sort $(filter-out main,$(MOD_SUBDIRS))); do $(SILENTMAKE) -C $${dir} SUBDIR=$${dir} makeopts >> $@; done
  790. @if [ "${AST_DEVMODE}" = "yes" ]; then \
  791. cat build_tools/cflags-devmode.xml >> $@; \
  792. fi
  793. @cat build_tools/embed_modules.xml >> $@
  794. @cat sounds/sounds.xml >> $@
  795. @echo "</menu>" >> $@
  796. pdf: asterisk.pdf
  797. asterisk.pdf:
  798. $(MAKE) -C doc/tex asterisk.pdf
  799. .PHONY: menuselect
  800. .PHONY: main
  801. .PHONY: sounds
  802. .PHONY: clean
  803. .PHONY: dist-clean
  804. .PHONY: distclean
  805. .PHONY: all
  806. .PHONY: prereqs
  807. .PHONY: cleantest
  808. .PHONY: uninstall
  809. .PHONY: _uninstall
  810. .PHONY: uninstall-all
  811. .PHONY: pdf
  812. .PHONY: dont-optimize
  813. .PHONY: badshell
  814. .PHONY: installdirs
  815. .PHONY: _clean
  816. .PHONY: $(SUBDIRS_INSTALL)
  817. .PHONY: $(SUBDIRS_DIST_CLEAN)
  818. .PHONY: $(SUBDIRS_CLEAN)
  819. .PHONY: $(SUBDIRS_UNINSTALL)
  820. .PHONY: $(SUBDIRS)
  821. .PHONY: $(MOD_SUBDIRS_EMBED_LDSCRIPT)
  822. .PHONY: $(MOD_SUBDIRS_EMBED_LDFLAGS)
  823. .PHONY: $(MOD_SUBDIRS_EMBED_LIBS)
  824. FORCE: