2 # Asterisk -- An open source telephony toolkit.
6 # Copyright (C) 1999-2010, Digium, Inc.
8 # Mark Spencer <markster@digium.com>
10 # This program is free software, distributed under the terms of
11 # the GNU General Public License
14 # All Makefiles use the following variables:
16 # ASTCFLAGS - compiler options provided by the user (if any)
17 # _ASTCFLAGS - compiler options provided by the build system
18 # ASTLDFLAGS - linker flags (not libraries) provided by the user (if any)
19 # _ASTLDFLAGS - linker flags (not libraries) provided by the build system
20 # LIBS - additional libraries, at top-level for all links,
21 # on a single object just for that object
22 # SOLINK - linker flags used only for creating dynamically loadable modules
24 # DYLINK - linker flags used only for creating shared libraries
25 # (.so files on Unix-type platforms, .dylib on Darwin)
27 # Values for ASTCFLAGS and ASTLDFLAGS can be specified in the
28 # environment when running make, as follows:
30 # $ ASTCFLAGS="-Werror" make ...
32 # or as a variable value on the make command line itself:
34 # $ make ASTCFLAGS="-Werror" ...
36 export ASTTOPDIR # Top level dir, used in subdirs' Makefiles
37 export ASTERISKVERSION
38 export ASTERISKVERSIONNUM
40 #--- values used for default paths
42 # DESTDIR is the staging (or final) directory where files are copied
43 # during the install process. Define it before 'export', otherwise
44 # export will set it to the empty string making ?= fail.
45 # Trying to run asterisk from the DESTDIR is completely unsupported
47 # WARNING: do not put spaces or comments after the value.
48 DESTDIR?=$(INSTALL_PATH)
51 export INSTALL_PATH # Additional prefix for the following paths
53 export ASTETCDIR # Path for config files
69 export OSARCH # Operating system
71 export NOISY_BUILD # Used in Makefile.rules
72 export MENUSELECT_CFLAGS # Options selected in menuselect.
73 export AST_DEVMODE # Set to "yes" for additional compiler
75 export AST_DEVMODE_STRICT # Enables shadow warnings (-Wshadow)
77 export _SOLINK # linker flags for all shared objects
78 export SOLINK # linker flags for loadable modules
79 export DYLINK # linker flags for shared libraries
81 #--- paths to various commands
82 # The makeopts include below tries to set these if they're found during
96 export WGET_EXTRA_ARGS
110 # makeopts is required unless the goal is just {dist{-}}clean
111 ifeq ($(MAKECMDGOALS),clean)
112 else ifeq ($(MAKECMDGOALS),distclean)
113 else ifeq ($(MAKECMDGOALS),dist-clean)
118 # start the primary CFLAGS and LDFLAGS with any that were provided
119 # to the configure script
120 _ASTCFLAGS:=$(CONFIG_CFLAGS) $(CONFIG_SIGNED_CHAR)
121 _ASTLDFLAGS:=$(CONFIG_LDFLAGS)
123 # Some build systems, such as the one in openwrt, like to pass custom target
124 # CFLAGS and LDFLAGS in the COPTS and LDOPTS variables; these should also
125 # go before any build-system computed flags, since they are defaults, not
128 _ASTLDFLAGS+=$(LDOPTS)
131 _ASTCFLAGS+=$(LIBXML2_INCLUDE)
134 _ASTCFLAGS+=$(BIND8_CFLAGS)
136 #Uncomment this to see all build commands instead of 'quiet' output
140 space:=$(empty) $(empty)
141 ASTTOPDIR:=$(subst $(space),\$(space),$(CURDIR))
143 # Overwrite config files on "make samples" or other config installation targets
146 # Include debug and macro symbols in the executables (-g) and profiling info (-pg)
149 # Asterisk.conf is located in ASTETCDIR or by using the -C flag
150 # when starting Asterisk
151 ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
152 AGI_DIR=$(ASTDATADIR)/agi-bin
154 # If you use Apache, you may determine by a grep 'DocumentRoot' of your httpd.conf file
155 HTTP_DOCSDIR=/var/www/html
156 # Determine by a grep 'ScriptAlias' of your Apache httpd.conf file
157 HTTP_CGIDIR=/var/www/cgi-bin
159 # If your platform's linker expects a prefix on symbols generated from compiling C
160 # source files, set LINKER_SYMBOL_PREFIX to that value. On some systems, exported symbols
161 # from C source files are prefixed with '_', for example. If this value is not set
162 # properly, the linker scripts that live in the '*.exports' files in various places
163 # in this tree will unintentionally suppress symbols that should be visible
164 # in the final binary objects.
165 LINKER_SYMBOL_PREFIX=
167 # Uncomment this to use the older DSP routines
168 #_ASTCFLAGS+=-DOLD_DSP_ROUTINES
170 # Default install directory for DAHDI hooks.
171 DAHDI_UDEV_HOOK_DIR = /usr/share/dahdi/span_config.d
173 # If the file .asterisk.makeopts is present in your home directory, you can
174 # include all of your favorite menuselect options so that every time you download
175 # a new version of Asterisk, you don't have to run menuselect to set them.
176 # The file /etc/asterisk.makeopts will also be included but can be overridden
177 # by the file in your home directory.
179 ifeq ($(wildcard menuselect.makeopts),)
180 USER_MAKEOPTS=$(wildcard ~/.asterisk.makeopts)
181 GLOBAL_MAKEOPTS=$(wildcard /etc/asterisk.makeopts)
188 MOD_SUBDIR_CFLAGS="-I$(ASTTOPDIR)/include"
189 OTHER_SUBDIR_CFLAGS="-I$(ASTTOPDIR)/include"
191 # Create OPTIONS variable, but probably we can assign directly to ASTCFLAGS
194 ifeq ($(findstring -save-temps,$(_ASTCFLAGS) $(ASTCFLAGS)),)
195 ifeq ($(findstring -pipe,$(_ASTCFLAGS) $(ASTCFLAGS)),)
200 ifeq ($(findstring -Wall,$(_ASTCFLAGS) $(ASTCFLAGS)),)
204 _ASTCFLAGS+=-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(AST_NESTED_FUNCTIONS) $(AST_CLANG_BLOCKS) $(DEBUG)
207 ifeq ($(AST_DEVMODE),yes)
210 _ASTCFLAGS+=$(AST_DECLARATION_AFTER_STATEMENT)
211 _ASTCFLAGS+=$(AST_TRAMPOLINES)
213 _ASTCFLAGS+=-Wmissing-format-attribute
214 _ASTCFLAGS+=-Wformat=2
215 ifeq ($(AST_DEVMODE_STRICT),yes)
218 ifneq ($(DISABLE_XMLDOC),yes)
219 ADDL_TARGETS+=validate-docs
223 ifeq ($(OSARCH),NetBSD)
224 _ASTCFLAGS+=-isystem /usr/pkg/include
225 else ifneq ($(findstring BSD,$(OSARCH)),)
226 _ASTCFLAGS+=-isystem /usr/local/include
229 ifeq ($(OSARCH),FreeBSD)
230 # -V is understood by BSD Make, not by GNU make.
231 BSDVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
232 _ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
235 ifeq ($(OSARCH),NetBSD)
236 _ASTCFLAGS+=-pthread -D__LIBPTHREAD_SOURCE__ -I/usr/pkg/include
239 ifeq ($(OSARCH),OpenBSD)
240 _ASTCFLAGS+=-pthread -ftrampolines
243 ifeq ($(OSARCH),linux-uclibc)
244 AST_LIBS+=-lpthread -ldl
247 ifeq ($(OSARCH),SunOS)
248 _ASTCFLAGS+=-Wcast-align -DSOLARIS -I../include/solaris-compat -I/opt/ssl/include -I/usr/local/ssl/include -D_XPG4_2 -D__EXTENSIONS__
252 else ifeq ($(GREP),:)
254 ASTERISKVERSION:=$(shell GREP=$(GREP) AWK=$(AWK) GIT=$(GIT) build_tools/make_version .)
257 ifneq ($(wildcard .version),)
258 ASTERISKVERSIONNUM:=$(shell $(SED) -e 's/^certified\///' -e 's/-cert/./' .version | $(AWK) -F. '{printf "%01d%02d%02d", $$1, $$2, $$3}')
262 ifneq ($(wildcard .svn),)
263 ASTERISKVERSIONNUM:=999999
266 ifneq ($(DISABLE_XMLDOC),yes)
267 CORE_XMLDOC=doc/core-en_US.xml
268 FULL_XMLDOC=doc/full-en_US.xml
274 _ASTCFLAGS+=$(OPTIONS)
276 MOD_SUBDIRS:=third-party channels pbx apps codecs formats cdr cel bridges funcs tests main res addons $(LOCAL_MOD_SUBDIRS)
277 OTHER_SUBDIRS:=utils agi contrib
278 SUBDIRS:=$(OTHER_SUBDIRS) $(MOD_SUBDIRS)
279 SUBDIRS_INSTALL:=$(SUBDIRS:%=%-install)
280 SUBDIRS_CLEAN:=$(SUBDIRS:%=%-clean)
281 SUBDIRS_DIST_CLEAN:=$(SUBDIRS:%=%-dist-clean)
282 SUBDIRS_UNINSTALL:=$(SUBDIRS:%=%-uninstall)
283 MOD_SUBDIRS_MENUSELECT_TREE:=$(MOD_SUBDIRS:%=%-menuselect-tree)
285 ifneq ($(findstring darwin,$(OSARCH)),)
286 _ASTCFLAGS+=-D__Darwin__ -mmacosx-version-min=10.6
287 _SOLINK=-mmacosx-version-min=10.6 -Wl,-undefined,dynamic_lookup
288 _SOLINK+=/usr/lib/bundle1.o
289 SOLINK=-bundle $(_SOLINK)
290 DYLINK=-Wl,-dylib $(_SOLINK)
291 _ASTLDFLAGS+=-L/usr/local/lib
293 # These are used for all but Darwin
296 ifeq ($(OSARCH),NetBSD)
297 _ASTLDFLAGS+=-L/usr/pkg/lib
298 else ifneq ($(findstring BSD,$(OSARCH)),)
299 _ASTLDFLAGS+=-L/usr/local/lib
303 # Include rpath settings
304 _ASTLDFLAGS+=$(AST_RPATH)
306 ifeq ($(OSARCH),SunOS)
307 SOLINK=-shared -fpic -L/usr/local/ssl/lib -lrt
311 ifeq ($(OSARCH),OpenBSD)
316 # comment to print directories during submakes
319 ifneq ($(INSIDE_EMACS),)
323 SILENTMAKE:=$(MAKE) --quiet --no-print-directory
324 ifneq ($(PRINT_DIR)$(NOISY_BUILD),)
327 SUBMAKE:=$(MAKE) --quiet --no-print-directory
330 mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
331 mkfile_dir := $(dir $(mkfile_path))
333 # $(MAKE) is printed in several places, and we want it to be a
334 # fixed size string. Define a variable whose name has also the
335 # same size, so we can easily align text.
336 ifeq ($(MAKE), gmake)
343 @echo " +--------- Asterisk Build Complete ---------+"
344 @echo " + Asterisk has successfully been built, and +"
345 @echo " + can be installed by running: +"
347 @echo " + $(mK) install +"
348 @echo " +-------------------------------------------+"
351 @echo " +--------- Asterisk Build Complete ---------+"
352 @echo " + Asterisk has successfully been built, and +"
353 @echo " + can be installed by running: +"
355 @echo " + $(mK) install +"
356 @echo " +-------------------------------------------+"
359 _all: makeopts $(SUBDIRS) $(CORE_XMLDOC) $(ADDL_TARGETS)
361 _full: makeopts $(SUBDIRS) $(FULL_XMLDOC) $(ADDL_TARGETS)
365 @echo "**** The configure script must be executed before running '$(MAKE)'."
366 @echo "**** Please run \"./configure\"."
370 menuselect.makeopts: menuselect/menuselect menuselect-tree makeopts build_tools/menuselect-deps $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS)
371 ifeq ($(filter %.menuselect,$(MAKECMDGOALS)),)
372 menuselect/menuselect --check-deps $@
373 menuselect/menuselect --check-deps $@ $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS)
376 $(MOD_SUBDIRS_MENUSELECT_TREE):
377 +@$(SUBMAKE) -C $(@:-menuselect-tree=) SUBDIR=$(@:-menuselect-tree=) moduleinfo
378 +@$(SUBMAKE) -C $(@:-menuselect-tree=) SUBDIR=$(@:-menuselect-tree=) makeopts
380 $(SUBDIRS): makeopts .lastclean main/version.c include/asterisk/build.h include/asterisk/buildopts.h defaults.h
382 ifeq ($(findstring $(OSARCH), mingw32 cygwin ),)
385 # Windows: we need to build main (i.e. the asterisk dll) first,
386 # followed by res, followed by the other directories, because
387 # dll symbols must be resolved during linking and not at runtime.
388 D1:= $(filter-out main,$(MOD_SUBDIRS))
389 D1:= $(filter-out res,$(D1))
395 $(MOD_SUBDIRS): makeopts
396 +@_ASTCFLAGS="$(MOD_SUBDIR_CFLAGS) $(_ASTCFLAGS)" ASTCFLAGS="$(ASTCFLAGS)" _ASTLDFLAGS="$(_ASTLDFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" $(SUBMAKE) --no-builtin-rules -C $@ SUBDIR=$@ all
398 $(OTHER_SUBDIRS): makeopts
399 +@_ASTCFLAGS="$(OTHER_SUBDIR_CFLAGS) $(_ASTCFLAGS)" ASTCFLAGS="$(ASTCFLAGS)" _ASTLDFLAGS="$(_ASTLDFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" $(SUBMAKE) --no-builtin-rules -C $@ SUBDIR=$@ all
401 defaults.h: makeopts .lastclean build_tools/make_defaults_h
402 @build_tools/make_defaults_h > $@.tmp
403 @cmp -s $@.tmp $@ || mv $@.tmp $@
406 main/version.c: FORCE menuselect.makeopts .lastclean
407 @build_tools/make_version_c > $@.tmp
408 @cmp -s $@.tmp $@ || mv $@.tmp $@
411 include/asterisk/buildopts.h: menuselect.makeopts .lastclean
412 @build_tools/make_buildopts_h > $@.tmp
413 @cmp -s $@.tmp $@ || mv $@.tmp $@
416 # build.h must depend on .lastclean, or parallel make may wipe it out after it's
418 include/asterisk/build.h: .lastclean
419 @build_tools/make_build_h > $@
422 +@$(SUBMAKE) -C $(@:-clean=) clean
424 $(SUBDIRS_DIST_CLEAN):
425 +@$(SUBMAKE) -C $(@:-dist-clean=) dist-clean
427 clean: $(SUBDIRS_CLEAN) _clean
431 rm -f include/asterisk/build.h
433 rm -f doc/core-en_US.xml
434 rm -f doc/full-en_US.xml
435 rm -f doc/rest-api/*.wiki
438 rm -f rest-api-templates/*.pyc
439 @$(MAKE) -C menuselect clean
440 cp -f .cleancount .lastclean
442 dist-clean: distclean
444 distclean: $(SUBDIRS_DIST_CLEAN) _clean
445 @$(MAKE) -C menuselect dist-clean
446 @$(MAKE) -C sounds dist-clean
447 rm -f menuselect.makeopts makeopts menuselect-tree menuselect.makedeps
448 rm -f config.log config.status config.cache
449 rm -rf autom4te.cache
450 rm -f include/asterisk/autoconfig.h
451 rm -f include/asterisk/buildopts.h
454 rm -f build_tools/menuselect-deps
456 datafiles: _all $(CORE_XMLDOC)
457 CFLAGS="$(_ASTCFLAGS) $(ASTCFLAGS)" build_tools/mkpkgconfig "$(DESTDIR)$(libdir)/pkgconfig";
459 # # Recursively install contents of the static-http directory, in case
460 # # extra content is provided there. See contrib/scripts/get_swagger_ui.sh
461 find static-http | while read x; do \
462 if test -d $$x; then \
463 $(INSTALL) -m 755 -d "$(DESTDIR)$(ASTDATADIR)/$$x"; \
465 $(INSTALL) -m 644 $$x "$(DESTDIR)$(ASTDATADIR)/$$x" ; \
468 ifneq ($(DISABLE_XMLDOC),yes)
469 $(INSTALL) -m 644 doc/core-en_US.xml "$(DESTDIR)$(ASTDATADIR)/static-http";
470 $(INSTALL) -m 644 doc/appdocsxml.xslt "$(DESTDIR)$(ASTDATADIR)/static-http";
472 if [ -d doc/tex/asterisk ] ; then \
473 $(INSTALL) -d "$(DESTDIR)$(ASTDATADIR)/static-http/docs" ; \
474 for n in doc/tex/asterisk/* ; do \
475 $(INSTALL) -m 644 $$n "$(DESTDIR)$(ASTDATADIR)/static-http/docs" ; \
478 for x in images/*.jpg; do \
479 $(INSTALL) -m 644 $$x "$(DESTDIR)$(ASTDATADIR)/images" ; \
481 $(MAKE) -C sounds install
482 find rest-api -name "*.json" | while read x; do \
483 $(INSTALL) -m 644 $$x "$(DESTDIR)$(ASTDATADIR)/rest-api" ; \
486 DOC_MOD_SUBDIRS := $(filter-out third-party,$(MOD_SUBDIRS))
487 XML_core_en_US := $(shell build_tools/make_xml_documentation --command=print_dependencies --source-tree=. --mod-subdirs="$(DOC_MOD_SUBDIRS)")
488 # core-en_US.xml is the normal documentation created with asterisk builds.
489 doc/core-en_US.xml: makeopts .lastclean $(XML_core_en_US)
490 @build_tools/make_xml_documentation --command=create_xml --source-tree=. --mod-subdirs="$(DOC_MOD_SUBDIRS)" \
491 --with-moduleinfo --output-file=$@
493 # The full-en_US.xml target is only called by the wiki documentation generation process
494 # and does special post-processing in preparation for uploading to the wiki.
495 # It creates full-en_US.xml but then re-creates core-en_US.xml as well.
496 doc/full-en_US.xml: makeopts .lastclean $(XML_core_en_US)
498 @echo "--------------------------------------------------------------------------"
499 @echo "--- Please install python to build full documentation ---"
500 @echo "--------------------------------------------------------------------------"
502 @build_tools/make_xml_documentation --command=create_xml --source-tree=. --mod-subdirs="$(DOC_MOD_SUBDIRS)" \
503 --for-wiki --output-file=$@ --core-output-file=./doc/core-en_US.xml
506 validate-docs: doc/core-en_US.xml
507 ifeq ($(XMLSTARLET)$(XMLLINT),::)
508 @echo "--------------------------------------------------------------------------"
509 @echo "--- Please install xmllint or xmlstarlet to validate the documentation ---"
510 @echo "--------------------------------------------------------------------------"
513 $(XMLLINT) --dtdvalid doc/appdocsxml.dtd --noout $<
515 $(XMLSTARLET) val -d doc/appdocsxml.dtd $<
520 @if [ -d .svn ]; then \
521 echo "Updating from Subversion..." ; \
522 fromrev="`svn info | $(AWK) '/Revision: / {print $$2}'`"; \
523 svn update | tee update.out; \
524 torev="`svn info | $(AWK) '/Revision: / {print $$2}'`"; \
525 echo "`date` Updated from revision $${fromrev} to $${torev}." >> update.log; \
527 if [ `grep -c ^C update.out` -gt 0 ]; then \
528 echo ; echo "The following files have conflicts:" ; \
529 grep ^C update.out | cut -b4- ; \
533 echo "Not under version control"; \
536 NEWHEADERS=$(notdir $(wildcard include/asterisk/*.h))
537 OLDHEADERS=$(filter-out $(NEWHEADERS) $(notdir $(DESTDIR)$(ASTHEADERDIR)),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h)))
538 INSTALLDIRS="$(ASTLIBDIR)" "$(ASTMODDIR)" "$(ASTSBINDIR)" "$(ASTCACHEDIR)" "$(ASTETCDIR)" "$(ASTVARRUNDIR)" \
539 "$(ASTSPOOLDIR)" "$(ASTSPOOLDIR)/dictate" "$(ASTSPOOLDIR)/meetme" \
540 "$(ASTSPOOLDIR)/monitor" "$(ASTSPOOLDIR)/system" "$(ASTSPOOLDIR)/tmp" \
541 "$(ASTSPOOLDIR)/voicemail" "$(ASTSPOOLDIR)/recording" \
542 "$(ASTLOGDIR)" "$(ASTLOGDIR)/cdr-csv" "$(ASTLOGDIR)/cdr-custom" \
543 "$(ASTLOGDIR)/cel-custom" "$(ASTDATADIR)" "$(ASTDATADIR)/documentation" \
544 "$(ASTDATADIR)/documentation/thirdparty" "$(ASTDATADIR)/firmware" \
545 "$(ASTDATADIR)/firmware/iax" "$(ASTDATADIR)/images" "$(ASTDATADIR)/keys" \
546 "$(ASTDATADIR)/phoneprov" "$(ASTDATADIR)/rest-api" "$(ASTDATADIR)/static-http" \
547 "$(ASTDATADIR)/sounds" "$(ASTDATADIR)/moh" "$(ASTMANDIR)/man8" "$(AGI_DIR)" "$(ASTDBDIR)" \
548 "$(ASTDATADIR)/third-party" "${ASTDATADIR}/keys/stir_shaken"
551 @for i in $(INSTALLDIRS); do \
552 if [ ! -z "$${i}" -a ! -d "$(DESTDIR)$${i}" ]; then \
553 $(INSTALL) -d "$(DESTDIR)$${i}"; \
558 +@DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" ASTLIBDIR="$(ASTLIBDIR)" $(SUBMAKE) -C main bininstall
560 bininstall: _all installdirs $(SUBDIRS_INSTALL) main-bininstall
561 $(INSTALL) -m 755 contrib/scripts/astversion "$(DESTDIR)$(ASTSBINDIR)/"
562 $(INSTALL) -m 755 contrib/scripts/astgenkey "$(DESTDIR)$(ASTSBINDIR)/"
563 $(INSTALL) -m 755 contrib/scripts/autosupport "$(DESTDIR)$(ASTSBINDIR)/"
564 ifneq ($(HAVE_SBIN_LAUNCHD),1)
565 ./build_tools/install_subst contrib/scripts/safe_asterisk "$(DESTDIR)$(ASTSBINDIR)/safe_asterisk";
568 ifneq ($(DISABLE_XMLDOC),yes)
569 $(INSTALL) -m 644 doc/core-*.xml "$(DESTDIR)$(ASTDATADIR)/documentation"
570 $(INSTALL) -m 644 doc/appdocsxml.xslt "$(DESTDIR)$(ASTDATADIR)/documentation"
571 $(INSTALL) -m 644 doc/appdocsxml.dtd "$(DESTDIR)$(ASTDATADIR)/documentation"
573 $(INSTALL) -m 644 doc/asterisk.8 "$(DESTDIR)$(ASTMANDIR)/man8"
574 $(INSTALL) -m 644 doc/astdb*.8 "$(DESTDIR)$(ASTMANDIR)/man8"
575 $(INSTALL) -m 644 contrib/scripts/astgenkey.8 "$(DESTDIR)$(ASTMANDIR)/man8"
576 $(INSTALL) -m 644 contrib/scripts/autosupport.8 "$(DESTDIR)$(ASTMANDIR)/man8"
577 $(INSTALL) -m 644 contrib/scripts/safe_asterisk.8 "$(DESTDIR)$(ASTMANDIR)/man8"
578 if [ -f contrib/firmware/iax/iaxy.bin ] ; then \
579 $(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin "$(DESTDIR)$(ASTDATADIR)/firmware/iax/iaxy.bin"; \
581 ifeq ($(HAVE_DAHDI),1)
582 $(INSTALL) -d $(DESTDIR)/$(DAHDI_UDEV_HOOK_DIR)
583 $(INSTALL) -m 644 contrib/scripts/dahdi_span_config_hook $(DESTDIR)$(DAHDI_UDEV_HOOK_DIR)/40-asterisk
587 +@DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" ASTDATADIR="$(ASTDATADIR)" $(SUBMAKE) -C $(@:-install=) install
589 NEWMODS:=$(foreach d,$(MOD_SUBDIRS),$(notdir $(wildcard $(d)/*.so)))
590 OLDMODS=$(filter-out $(NEWMODS) $(notdir $(DESTDIR)$(ASTMODDIR)),$(notdir $(wildcard $(DESTDIR)$(ASTMODDIR)/*.so)))
592 FILMODS=$(filter-out $(shell ./build_tools/list_valid_installed_externals),$(OLDMODS))
596 BADMODS=$(strip $(FILMODS))
599 @if [ -n "$(BADMODS)" ]; then \
600 echo " WARNING WARNING WARNING" ;\
602 echo " Your Asterisk modules directory, located at" ;\
603 echo " $(DESTDIR)$(ASTMODDIR)" ;\
604 echo " contains modules that were not installed by this " ;\
605 echo " version of Asterisk. Please ensure that these" ;\
606 echo " modules are compatible with this version before" ;\
607 echo " attempting to run Asterisk." ;\
609 for f in $(BADMODS); do \
613 echo " WARNING WARNING WARNING" ;\
618 else ifeq ($(LDCONFIG),:)
620 ifeq ($(DESTDIR),) # DESTDIR means binary archive creation; ldconfig should be run on postinst
621 @if [ $$(id -u) -eq 0 ] ; then \
622 $(LDCONFIG) "$(ASTLIBDIR)/" ; \
624 echo " WARNING WARNING WARNING" ;\
626 echo " You cannot rebuild the system linker cache unless you are root. " ;\
627 echo " You MUST do one of the following..." ;\
628 echo " * Re-run 'make install' as root. " ;\
629 echo " * Run 'ldconfig $(ASTLIBDIR)' as root. " ;\
630 echo " * Run asterisk with 'LD_LIBRARY_PATH=$(ASTLIBDIR) asterisk' " ;\
632 echo " WARNING WARNING WARNING" ;\
639 ifeq ($(findstring 64,$(HOST_CPU)),64)
640 # Strip any trailing '/' so the dir and notdir functions work correctly
641 _current_libdir = $(patsubst %/,%,$(DESTDIR)$(ASTLIBDIR))
643 # Only process if the paths end in lib64 or lib.
644 # If we're installing to lib64, check lib for orphans.
645 # If we're installing to lib, check lib64 for orphans.
646 # Otherwise, leave _oldlibdir empty.
647 ifeq ($(notdir $(_current_libdir)),lib64)
648 _oldlibdir = $(dir $(_current_libdir))lib
649 else ifeq ($(notdir $(_current_libdir)),lib)
650 _oldlibdir = $(dir $(_current_libdir))lib64
653 # Strip any trailing '/' so the dir and notdir functions work correctly
654 _current_moddir = $(patsubst %/,%,$(DESTDIR)$(ASTMODDIR))
656 # Only process if the paths contain /lib64/ or /lib/.
657 # If we're installing to lib64, check lib for orphans.
658 # If we're installing to lib, check lib64 for orphans.
659 # Otherwise, leave _oldmoddir empty.
660 ifeq ($(findstring /lib64/,$(_current_moddir)),/lib64/)
661 _oldmoddir = $(subst /lib64/,/lib/,$(_current_moddir))
662 else ifeq ($(findstring /lib/,$(_current_moddir)),/lib/)
663 _oldmoddir = $(subst /lib/,/lib64/,$(_current_moddir))
668 @test -n "$(_oldlibdir)" -a -d "$(_oldlibdir)" || exit 0 ;\
669 oldfiles=`find "$(_oldlibdir)" -name libasterisk* -print -quit -o \( -path *asterisk/modules/* -a -name *.so \) -print -quit 2>/dev/null` ;\
670 if [ "x$$oldfiles" != "x" ] ; then \
671 echo " WARNING WARNING WARNING" ;\
673 echo " Installation is to: " ;\
674 echo " $(DESTDIR)$(ASTLIBDIR)" ;\
675 echo " but there are asterisk shared libraries in: " ;\
676 echo " $(_oldlibdir)" ;\
678 echo " $(_oldlibdir)/asterisk/modules" ;\
680 echo " It is unlikely that asterisk will start." ;\
682 echo " You should do one of the following..." ;\
683 echo " * Run 'make uninstall' to remove the incorrect libraries" ;\
684 echo " then run 'make install' again." ;\
685 echo " * Manually remove the libraries from" ;\
686 echo " $(_oldlibdir)" ;\
687 echo " and run 'ldconfig' to rebuild the linker cache." ;\
689 echo " WARNING WARNING WARNING" ;\
693 ifneq ($(filter ~%,$(DESTDIR)),)
694 @echo "Your shell doesn't do ~ expansion when expected (specifically, when doing \"make install DESTDIR=~/path\")."
695 @echo "Try replacing ~ with \$$HOME, as in \"make install DESTDIR=\$$HOME/path\"."
700 ifeq ($(ASTERISKVERSION),UNKNOWN__git_check_fail)
701 @echo "Asterisk Version is unknown due to a git error. If you are running make"
702 @echo "as a different user than the project owner, this can be resolved by"
703 @echo "running the following command as the user currently executing make: "$$USER
704 @echo "git config --global --add safe.directory "$(mkfile_dir:/=)
709 install: badshell versioncheck bininstall datafiles
710 @if [ -x /usr/sbin/asterisk-post-install ]; then \
711 /usr/sbin/asterisk-post-install "$(DESTDIR)" . ; \
713 @echo " +---- Asterisk Installation Complete -------+"
715 @echo " + YOU MUST READ THE SECURITY DOCUMENT +"
717 @echo " + Asterisk has successfully been installed. +"
718 @echo " + If you would like to install the sample +"
719 @echo " + configuration files (overwriting any +"
720 @echo " + existing config files), run: +"
722 @echo " + For generic reference documentation: +"
723 @echo " + $(mK) samples +"
725 @echo " + For a sample basic PBX: +"
726 @echo " + $(mK) basic-pbx +"
729 @echo " +----------------- or ---------------------+"
731 @echo " + You can go ahead and install the asterisk +"
732 @echo " + program documentation now or later run: +"
734 @echo " + $(mK) progdocs +"
736 @echo " + **Note** This requires that you have +"
737 @echo " + doxygen installed on your local system +"
738 @echo " +-------------------------------------------+"
739 @$(MAKE) -s oldmodcheck
740 @$(MAKE) -s ld-cache-update
741 @$(MAKE) -s check-old-libdir
748 # Install configuration files from the specified directory
750 # (1) the configuration directory to install from
751 # (2) the extension to strip off
752 define INSTALL_CONFIGS
753 @for x in $(1)/*$(2); do \
754 dst="$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x $(2)`"; \
755 if [ -f "$${dst}" ]; then \
756 if [ "$(OVERWRITE)" = "y" ]; then \
757 if cmp -s "$${dst}" "$$x" ; then \
758 echo "Config file $$x is unchanged"; \
761 mv -f "$${dst}" "$${dst}.old" ; \
763 echo "Skipping config file $$x"; \
767 echo "Installing file $$x"; \
768 $(INSTALL) -m 644 "$$x" "$${dst}" ;\
770 if [ "$(OVERWRITE)" = "y" ]; then \
771 echo "Updating asterisk.conf" ; \
772 sed -e 's|^astcachedir.*$$|astcachedir => $(ASTCACHEDIR)|' \
773 -e 's|^astetcdir.*$$|astetcdir => $(ASTETCDIR)|' \
774 -e 's|^astmoddir.*$$|astmoddir => $(ASTMODDIR)|' \
775 -e 's|^astvarlibdir.*$$|astvarlibdir => $(ASTVARLIBDIR)|' \
776 -e 's|^astdbdir.*$$|astdbdir => $(ASTDBDIR)|' \
777 -e 's|^astkeydir.*$$|astkeydir => $(ASTKEYDIR)|' \
778 -e 's|^astdatadir.*$$|astdatadir => $(ASTDATADIR)|' \
779 -e 's|^astagidir.*$$|astagidir => $(AGI_DIR)|' \
780 -e 's|^astspooldir.*$$|astspooldir => $(ASTSPOOLDIR)|' \
781 -e 's|^astrundir.*$$|astrundir => $(ASTVARRUNDIR)|' \
782 -e 's|^astlogdir.*$$|astlogdir => $(ASTLOGDIR)|' \
783 -e 's|^astsbindir.*$$|astsbindir => $(ASTSBINDIR)|' \
784 "$(DESTDIR)$(ASTCONFPATH)" > "$(DESTDIR)$(ASTCONFPATH).tmp" ; \
785 $(INSTALL) -m 644 "$(DESTDIR)$(ASTCONFPATH).tmp" "$(DESTDIR)$(ASTCONFPATH)" ; \
786 rm -f "$(DESTDIR)$(ASTCONFPATH).tmp" ; \
791 # Will create all components of "$(DESTDIR)$(ASTHEADERDIR)/doxygen" including "$(DESTDIR)$(includedir)"
792 $(INSTALL) -d "$(DESTDIR)$(ASTHEADERDIR)/doxygen"
793 $(INSTALL) -m 644 include/asterisk.h "$(DESTDIR)$(includedir)"
794 $(INSTALL) -m 644 include/asterisk/*.h "$(DESTDIR)$(ASTHEADERDIR)"
795 $(INSTALL) -m 644 include/asterisk/doxygen/*.h "$(DESTDIR)$(ASTHEADERDIR)/doxygen"
796 if [ -n "$(OLDHEADERS)" ]; then \
797 for h in $(OLDHEADERS); do rm -f "$(DESTDIR)$(ASTHEADERDIR)/$$h"; done \
801 @if test -z "$(CONFIG_SRC)" -o ! -d "$(CONFIG_SRC)"; then \
802 >&2 echo "CONFIG_SRC must be set to a directory."; \
805 @echo "Installing config files from $(CONFIG_SRC)/*$(CONFIG_EXTEN)"
806 $(call INSTALL_CONFIGS,$(CONFIG_SRC),$(CONFIG_EXTEN))
808 # XXX why *.adsi is installed first ?
810 @echo Installing adsi config files...
811 $(INSTALL) -d "$(DESTDIR)$(ASTETCDIR)"
812 @for x in configs/samples/*.adsi; do \
813 dst="$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x`" ; \
814 if [ -f "$${dst}" ] ; then \
815 echo "Overwriting $$x" ; \
817 echo "Installing $$x" ; \
819 $(INSTALL) -m 644 "$$x" "$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x`" ; \
823 @echo Installing other config files...
824 $(call INSTALL_CONFIGS,configs/samples,.sample)
825 $(INSTALL) -d "$(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX"
826 build_tools/make_sample_voicemail "$(DESTDIR)/$(ASTDATADIR)" "$(DESTDIR)/$(ASTSPOOLDIR)"
827 @for x in phoneprov/*; do \
828 dst="$(DESTDIR)$(ASTDATADIR)/$$x" ; \
829 if [ -f "$${dst}" ]; then \
830 if [ "$(OVERWRITE)" = "y" ]; then \
831 if cmp -s "$${dst}" "$$x" ; then \
832 echo "Config file $$x is unchanged"; \
835 mv -f "$${dst}" "$${dst}.old" ; \
837 echo "Skipping config file $$x"; \
841 echo "Installing file $$x"; \
842 $(INSTALL) -m 644 "$$x" "$${dst}" ;\
846 @echo Installing basic-pbx config files...
847 $(call INSTALL_CONFIGS,configs/basic-pbx)
850 @[ -d "$(DESTDIR)$(HTTP_DOCSDIR)/" ] || ( printf "http docs directory not found.\nUpdate assignment of variable HTTP_DOCSDIR in Makefile!\n" && exit 1 )
851 @[ -d "$(DESTDIR)$(HTTP_CGIDIR)" ] || ( printf "cgi-bin directory not found.\nUpdate assignment of variable HTTP_CGIDIR in Makefile!\n" && exit 1 )
852 $(INSTALL) -m 4755 contrib/scripts/vmail.cgi "$(DESTDIR)$(HTTP_CGIDIR)/vmail.cgi"
853 $(INSTALL) -d "$(DESTDIR)$(HTTP_DOCSDIR)/_asterisk"
854 for x in images/*.gif; do \
855 $(INSTALL) -m 644 $$x "$(DESTDIR)$(HTTP_DOCSDIR)/_asterisk/"; \
857 @echo " +--------- Asterisk Web Voicemail ----------+"
859 @echo " + Asterisk Web Voicemail is installed in +"
860 @echo " + your cgi-bin directory: +"
861 @echo " + $(DESTDIR)$(HTTP_CGIDIR)"
862 @echo " + IT USES A SETUID ROOT PERL SCRIPT, SO +"
863 @echo " + IF YOU DON'T LIKE THAT, UNINSTALL IT! +"
865 @echo " + Other static items have been stored in: +"
866 @echo " + $(DESTDIR)$(HTTP_DOCSDIR)"
868 @echo " + If these paths do not match your httpd +"
869 @echo " + installation, correct the definitions +"
870 @echo " + in your Makefile of HTTP_CGIDIR and +"
871 @echo " + HTTP_DOCSDIR +"
873 @echo " +-------------------------------------------+"
877 @echo "Doxygen is not installed. Please install and re-run the configuration script."
879 @cp doc/Doxyfile.in doc/Doxyfile
881 @echo "DOT is not installed. Doxygen will not produce any diagrams. Please install and re-run the configuration script."
883 @echo "HAVE_DOT = YES" >> doc/Doxyfile
885 ifneq ($(NOISY_BUILD),yes)
886 @echo "EXTRACT_ALL = YES" >> doc/Doxyfile
888 ifeq ($(AST_DEVMODE),yes)
889 @echo "INTERNAL_DOCS = YES" >> doc/Doxyfile
890 @echo "WARN_NO_PARAMDOC = YES" >> doc/Doxyfile
892 ifeq ($(ASTERISKVERSION),UNKNOWN__and_probably_unsupported)
893 @echo "Asterisk Version is unknown, not configuring Doxygen PROJECT_NUMBER."
894 else ifeq ($(ASTERISKVERSION),UNKNOWN__git_check_fail)
895 @echo "Asterisk Version is unknown due to a git error. If you are running make"
896 @echo "as a different user than the project owner, this can be resolved by"
897 @echo "running the following command as the user currently executing make: "$$USER
898 @echo "git config --global --add safe.directory "$(mkfile_dir:/=)
899 @echo "not configuring Doxygen PROJECT_NUMBER."
901 @echo "PROJECT_NUMBER = $(ASTERISKVERSION)" >> doc/Doxyfile
903 @echo "Generating C-API documentation. This will take a while."
904 @doxygen doc/Doxyfile
905 @echo "Generation complete. Any warnings are in ./doxygen.log."
909 if [ ! -d "$(DESTDIR)$(ASTETCDIR)/../logrotate.d" ]; then \
910 $(INSTALL) -d "$(DESTDIR)$(ASTETCDIR)/../logrotate.d" ; \
912 sed 's#__LOGDIR__#$(ASTLOGDIR)#g' < contrib/scripts/asterisk.logrotate | sed 's#__SBINDIR__#$(ASTSBINDIR)#g' > contrib/scripts/asterisk.logrotate.tmp
913 $(INSTALL) -m 0644 contrib/scripts/asterisk.logrotate.tmp "$(DESTDIR)$(ASTETCDIR)/../logrotate.d/asterisk"
914 rm -f contrib/scripts/asterisk.logrotate.tmp
917 @if [ -f /etc/redhat-release -o -f /etc/fedora-release ]; then \
918 ./build_tools/install_subst contrib/init.d/rc.redhat.asterisk "$(DESTDIR)/etc/rc.d/init.d/asterisk"; \
919 if [ ! -f "$(DESTDIR)/etc/sysconfig/asterisk" ] ; then \
920 $(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/sysconfig/asterisk" ; \
922 if [ -z "$(DESTDIR)" ] ; then \
923 /sbin/chkconfig --add asterisk ; \
925 elif [ -f /etc/debian_version ] ; then \
926 ./build_tools/install_subst contrib/init.d/rc.debian.asterisk "$(DESTDIR)/etc/init.d/asterisk"; \
927 if [ ! -f "$(DESTDIR)/etc/default/asterisk" ] ; then \
928 $(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/default/asterisk" ; \
930 if [ -z "$(DESTDIR)" ] ; then \
931 /usr/sbin/update-rc.d asterisk defaults 50 91 ; \
933 elif [ -f /etc/gentoo-release ] ; then \
934 ./build_tools/install_subst contrib/init.d/rc.gentoo.asterisk "$(DESTDIR)/etc/init.d/asterisk"; \
935 if [ -z "$(DESTDIR)" ] ; then \
936 /sbin/rc-update add asterisk default ; \
938 elif [ -f /etc/mandrake-release -o -f /etc/mandriva-release ] ; then \
939 ./build_tools/install_subst contrib/init.d/rc.mandriva.asterisk "$(DESTDIR)/etc/rc.d/init.d/asterisk"; \
940 if [ ! -f /etc/sysconfig/asterisk ] ; then \
941 $(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/sysconfig/asterisk" ; \
943 if [ -z "$(DESTDIR)" ] ; then \
944 /sbin/chkconfig --add asterisk ; \
946 elif [ -f /etc/SuSE-release -o -f /etc/novell-release ] ; then \
947 ./build_tools/install_subst contrib/init.d/rc.suse.asterisk "$(DESTDIR)/etc/init.d/asterisk"; \
948 if [ ! -f /etc/sysconfig/asterisk ] ; then \
949 $(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/sysconfig/asterisk" ; \
951 if [ -z "$(DESTDIR)" ] ; then \
952 /sbin/chkconfig --add asterisk ; \
954 elif [ -f /etc/os-release ] && [ "opensuse" = "$(shell . /etc/os-release 2>/dev/null && echo $$ID)" ] ; then \
955 ./build_tools/install_subst contrib/init.d/rc.suse.asterisk "$(DESTDIR)/etc/init.d/asterisk"; \
956 if [ ! -f /etc/sysconfig/asterisk ] ; then \
957 $(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/sysconfig/asterisk" ; \
959 if [ -z "$(DESTDIR)" ] ; then \
960 /sbin/chkconfig --add asterisk ; \
962 elif [ -f /etc/arch-release -o -f /etc/arch-release ] ; then \
963 ./build_tools/install_subst contrib/init.d/rc.archlinux.asterisk "$(DESTDIR)/etc/init.d/asterisk"; \
964 elif [ -f /etc/slackware-version ]; then \
965 ./build_tools/install_subst contrib/init.d/rc.slackware.asterisk "$(DESTDIR)/etc/rc.d/rc.asterisk"; \
966 elif [ -f /etc/os-release ] && [ "slackware" = "$(shell . /etc/os-release 2>/dev/null && echo $$ID)" ] ; then \
967 ./build_tools/install_subst contrib/init.d/rc.slackware.asterisk "$(DESTDIR)/etc/rc.d/rc.asterisk"; \
968 elif [ -d "$(DESTDIR)/Library/LaunchDaemons" ]; then \
969 if [ ! -f "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.asterisk.plist" ]; then \
970 ./build_tools/install_subst contrib/init.d/org.asterisk.asterisk.plist "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.asterisk.plist"; \
972 if [ ! -f "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.muted.plist" ]; then \
973 ./build_tools/install_subst contrib/init.d/org.asterisk.muted.plist "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.muted.plist"; \
976 echo "We could not install init scripts for your distribution." ; \
980 $(MAKE) -C sounds all
982 # If the cleancount has been changed, force a make clean.
983 # .cleancount is the global clean count, and .lastclean is the
984 # last clean count we had
986 .lastclean: .cleancount
988 @[ -f "$(DESTDIR)$(ASTDBDIR)/astdb.sqlite3" ] || [ ! -f "$(DESTDIR)$(ASTDBDIR)/astdb" ] || [ ! -f menuselect.makeopts ] || grep -q MENUSELECT_UTILS=.*astdb2sqlite3 menuselect.makeopts || (sed -i.orig -e's/MENUSELECT_UTILS=\(.*\)/MENUSELECT_UTILS=\1 astdb2sqlite3/' menuselect.makeopts && echo "Updating menuselect.makeopts to include astdb2sqlite3" && echo "Original version backed up to menuselect.makeopts.orig")
991 $(SUBDIRS_UNINSTALL):
992 +@DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" ASTDATADIR="$(ASTDATADIR)" $(SUBMAKE) -C $(@:-uninstall=) uninstall
995 +@DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" ASTLIBDIR="$(ASTLIBDIR)" $(SUBMAKE) -C main binuninstall
998 rm -rf "$(DESTDIR)$(ASTHEADERDIR)"
999 rm -f "$(DESTDIR)$(includedir)/asterisk.h"
1001 _uninstall: $(SUBDIRS_UNINSTALL) main-binuninstall
1002 rm -f "$(DESTDIR)$(ASTMODDIR)/"*
1003 test -n "$(_oldmoddir)" -a -d "$(_oldmoddir)" && rm -f "$(_oldmoddir)/"* || :
1004 rm -f "$(DESTDIR)$(ASTSBINDIR)/astgenkey"
1005 rm -f "$(DESTDIR)$(ASTSBINDIR)/autosupport"
1006 rm -rf "$(DESTDIR)$(ASTDATADIR)/firmware"
1007 rm -f "$(DESTDIR)$(ASTMANDIR)/man8/asterisk.8"
1008 rm -f "$(DESTDIR)$(ASTMANDIR)/man8/astgenkey.8"
1009 rm -f "$(DESTDIR)$(ASTMANDIR)/man8/autosupport.8"
1010 rm -f "$(DESTDIR)$(ASTMANDIR)/man8/safe_asterisk.8"
1011 ifeq ($(HAVE_DAHDI),1)
1012 rm -f $(DESTDIR)$(DAHDI_UDEV_HOOK_DIR)/40-asterisk
1014 $(MAKE) -C sounds uninstall
1016 else ifeq ($(LDCONFIG),:)
1018 $(LDCONFIG) "$(ASTLIBDIR)/" || :
1021 uninstall: _uninstall
1022 @echo " +--------- Asterisk Uninstall Complete -----+"
1023 @echo " + Asterisk binaries, sounds, man pages, +"
1024 @echo " + headers, modules, and firmware builds, +"
1025 @echo " + have all been uninstalled. +"
1027 @echo " + To remove ALL traces of Asterisk, +"
1028 @echo " + including configuration, spool +"
1029 @echo " + directories, and logs, run the following +"
1030 @echo " + command: +"
1032 @echo " + $(mK) uninstall-all +"
1033 @echo " +-------------------------------------------+"
1035 uninstall-all: _uninstall uninstall-headers
1036 rm -rf "$(DESTDIR)$(ASTMODDIR)"
1037 test -n "$(_oldmoddir)" -a -d "$(_oldmoddir)" && rm -rf "$(_oldmoddir)" || :
1038 rm -rf "$(DESTDIR)$(ASTVARLIBDIR)"
1039 rm -rf "$(DESTDIR)$(ASTDATADIR)"
1040 rm -rf "$(DESTDIR)$(ASTSPOOLDIR)"
1041 rm -rf "$(DESTDIR)$(ASTETCDIR)"
1042 rm -rf "$(DESTDIR)$(ASTLOGDIR)"
1043 rm -rf "$(DESTDIR)$(ASTCACHEDIR)"
1045 menuconfig: menuselect
1047 cmenuconfig: cmenuselect
1049 gmenuconfig: gmenuselect
1051 nmenuconfig: nmenuselect
1053 menuselect: menuselect/cmenuselect menuselect/nmenuselect menuselect/gmenuselect
1054 @if [ -x menuselect/nmenuselect ]; then \
1055 $(MAKE) nmenuselect; \
1056 elif [ -x menuselect/cmenuselect ]; then \
1057 $(MAKE) cmenuselect; \
1058 elif [ -x menuselect/gmenuselect ]; then \
1059 $(MAKE) gmenuselect; \
1061 echo "No menuselect user interface found. Install ncurses,"; \
1062 echo "newt or GTK libraries to build one and re-rerun"; \
1063 echo "'./configure' and 'make menuselect'."; \
1066 cmenuselect: menuselect/cmenuselect menuselect-tree menuselect.makeopts
1067 -@menuselect/cmenuselect menuselect.makeopts && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
1069 gmenuselect: menuselect/gmenuselect menuselect-tree menuselect.makeopts
1070 -@menuselect/gmenuselect menuselect.makeopts && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
1072 nmenuselect: menuselect/nmenuselect menuselect-tree menuselect.makeopts
1073 -@menuselect/nmenuselect menuselect.makeopts && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
1075 # options for make in menuselect/
1076 MAKE_MENUSELECT=CC="$(BUILD_CC)" CXX="$(CXX)" LD="" AR="" RANLIB="" \
1077 CFLAGS="$(BUILD_CFLAGS)" LDFLAGS="$(BUILD_LDFLAGS)" \
1078 $(MAKE) -C menuselect CONFIGURE_SILENT="--silent"
1080 menuselect/menuselect: menuselect/makeopts .lastclean
1081 +$(MAKE_MENUSELECT) menuselect
1083 menuselect/cmenuselect: menuselect/makeopts .lastclean
1084 +$(MAKE_MENUSELECT) cmenuselect
1086 menuselect/gmenuselect: menuselect/makeopts .lastclean
1087 +$(MAKE_MENUSELECT) gmenuselect
1089 menuselect/nmenuselect: menuselect/makeopts .lastclean
1090 +$(MAKE_MENUSELECT) nmenuselect
1092 menuselect/makeopts: makeopts .lastclean
1093 +$(MAKE_MENUSELECT) makeopts
1095 menuselect-tree: $(foreach dir,$(filter-out main,$(MOD_SUBDIRS)),$(wildcard $(dir)/*.c) $(wildcard $(dir)/*.cc) $(wildcard $(dir)/*.xml)) build_tools/cflags.xml build_tools/cflags-devmode.xml sounds/sounds.xml utils/utils.xml agi/agi.xml configure makeopts
1096 @echo "Generating input for menuselect ..."
1097 @echo "<?xml version=\"1.0\"?>" > $@
1099 @echo "<menu name=\"Asterisk Module and Build Option Selection\">" >> $@
1100 +@for dir in $(sort $(filter-out main,$(MOD_SUBDIRS))); do $(SILENTMAKE) -C $${dir} SUBDIR=$${dir} moduleinfo >> $@; done
1101 @cat build_tools/cflags.xml >> $@
1102 +@for dir in $(sort $(filter-out main,$(MOD_SUBDIRS))); do $(SILENTMAKE) -C $${dir} SUBDIR=$${dir} makeopts >> $@; done
1103 @if [ "${AST_DEVMODE}" = "yes" ]; then \
1104 cat build_tools/cflags-devmode.xml >> $@; \
1106 @cat utils/utils.xml >> $@
1107 @cat agi/agi.xml >> $@
1108 @cat sounds/sounds.xml >> $@
1109 @echo "</menu>" >> $@
1111 # We don't want to require Python or Pystache for every build, so this is its
1115 @echo "--------------------------------------------------------------------------"
1116 @echo "--- Please install python to build ARI stubs ---"
1117 @echo "--------------------------------------------------------------------------"
1120 @$(INSTALL) -d doc/rest-api
1121 $(PYTHON) rest-api-templates/make_ari_stubs.py \
1122 rest-api/resources.json .
1125 check-alembic: makeopts
1126 @find contrib/ast-db-manage/ -name '*.pyc' -delete
1127 @ALEMBIC=$(ALEMBIC) build_tools/make_check_alembic config cdr voicemail >&2
1129 .PHONY: install-configs
1130 .PHONY: install-headers
1143 .PHONY: uninstall-all
1144 .PHONY: uninstall-headers
1148 .PHONY: validate-docs
1152 .PHONY: check-alembic
1153 .PHONY: ld-cache-update
1154 .PHONY: check-old-libdir
1155 .PHONY: $(SUBDIRS_INSTALL)
1156 .PHONY: $(SUBDIRS_DIST_CLEAN)
1157 .PHONY: $(SUBDIRS_CLEAN)
1158 .PHONY: $(SUBDIRS_UNINSTALL)
1163 # This only stops targets within the root Makefile from building in parallel.