Merge "channels/chan_pjsip: Add PJSIP_SEND_SESSION_REFRESH"
[asterisk/asterisk.git] / Makefile
index a07a329..bf8f0f8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -249,7 +249,7 @@ endif
 
 _ASTCFLAGS+=$(OPTIONS)
 
-MOD_SUBDIRS:=channels pbx apps codecs formats cdr cel bridges funcs tests main res addons $(LOCAL_MOD_SUBDIRS)
+MOD_SUBDIRS:=third-party channels pbx apps codecs formats cdr cel bridges funcs tests main res addons $(LOCAL_MOD_SUBDIRS)
 OTHER_SUBDIRS:=utils agi contrib
 SUBDIRS:=$(OTHER_SUBDIRS) $(MOD_SUBDIRS)
 SUBDIRS_INSTALL:=$(SUBDIRS:%=%-install)
@@ -377,8 +377,10 @@ ifeq ($(findstring $(OSARCH), mingw32 cygwin ),)
     # directories containing them must be completed before the main Asterisk
     # binary can be built.
     # If MENUSELECT_EMBED is empty, we don't need this and allow 'main' to be
-    # be built without building all dependencies first.
+    # be built with only third_party first.
 main: $(filter-out main,$(MOD_SUBDIRS))
+  else
+main: third-party
   endif
 else
     # Windows: we need to build main (i.e. the asterisk dll) first,
@@ -489,7 +491,7 @@ doc/core-en_US.xml: makeopts .lastclean $(XML_core_en_US)
        @printf "Building Documentation For: "
        @echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > $@
        @echo "<!DOCTYPE docs SYSTEM \"appdocsxml.dtd\">" >> $@
-       @echo "<?xml-stylesheet type=\"text/xsl\" href=\"appdocsxml.xslt\"?>" > $@
+       @echo "<?xml-stylesheet type=\"text/xsl\" href=\"appdocsxml.xslt\"?>" >> $@
        @echo "<docs xmlns:xi=\"http://www.w3.org/2001/XInclude\">" >> $@
        @for x in $(MOD_SUBDIRS); do \
                printf "$$x " ; \
@@ -513,7 +515,7 @@ else
        @printf "Building Documentation For: "
        @echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > $@
        @echo "<!DOCTYPE docs SYSTEM \"appdocsxml.dtd\">" >> $@
-       @echo "<?xml-stylesheet type=\"text/xsl\" href=\"appdocsxml.xslt\"?>" > $@
+       @echo "<?xml-stylesheet type=\"text/xsl\" href=\"appdocsxml.xslt\"?>" >> $@
        @echo "<docs xmlns:xi=\"http://www.w3.org/2001/XInclude\">" >> $@
        @for x in $(MOD_SUBDIRS); do \
                printf "$$x " ; \
@@ -568,7 +570,8 @@ INSTALLDIRS="$(ASTLIBDIR)" "$(ASTMODDIR)" "$(ASTSBINDIR)" "$(ASTETCDIR)" "$(ASTV
        "$(ASTDATADIR)/documentation/thirdparty" "$(ASTDATADIR)/firmware" \
        "$(ASTDATADIR)/firmware/iax" "$(ASTDATADIR)/images" "$(ASTDATADIR)/keys" \
        "$(ASTDATADIR)/phoneprov" "$(ASTDATADIR)/rest-api" "$(ASTDATADIR)/static-http" \
-       "$(ASTDATADIR)/sounds" "$(ASTDATADIR)/moh" "$(ASTMANDIR)/man8" "$(AGI_DIR)" "$(ASTDBDIR)"
+       "$(ASTDATADIR)/sounds" "$(ASTDATADIR)/moh" "$(ASTMANDIR)/man8" "$(AGI_DIR)" "$(ASTDBDIR)" \
+       "$(ASTDATADIR)/third-party"
 
 installdirs:
        @for i in $(INSTALLDIRS); do \
@@ -611,7 +614,7 @@ ifeq ($(HAVE_DAHDI),1)
 endif
 
 $(SUBDIRS_INSTALL):
-       +@DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" $(SUBMAKE) -C $(@:-install=) install
+       +@DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" ASTDATADIR="$(ASTDATADIR)" $(SUBMAKE) -C $(@:-install=) install
 
 NEWMODS:=$(foreach d,$(MOD_SUBDIRS),$(notdir $(wildcard $(d)/*.so)))
 OLDMODS=$(filter-out $(NEWMODS) $(notdir $(DESTDIR)$(ASTMODDIR)),$(notdir $(wildcard $(DESTDIR)$(ASTMODDIR)/*.so)))
@@ -821,60 +824,56 @@ install-logrotate:
        rm -f contrib/scripts/asterisk.logrotate.tmp
 
 config:
-       @if [ "${OSARCH}" = "linux-gnu" -o "${OSARCH}" = "kfreebsd-gnu" ]; then \
-               if [ -f /etc/redhat-release -o -f /etc/fedora-release ]; then \
-                       ./build_tools/install_subst contrib/init.d/rc.redhat.asterisk  "$(DESTDIR)/etc/rc.d/init.d/asterisk"; \
-                       if [ ! -f "$(DESTDIR)/etc/sysconfig/asterisk" ] ; then \
-                               $(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/sysconfig/asterisk" ; \
-                       fi ; \
-                       if [ -z "$(DESTDIR)" ] ; then \
-                               /sbin/chkconfig --add asterisk ; \
-                       fi ; \
-               elif [ -f /etc/debian_version ] ; then \
-                       ./build_tools/install_subst contrib/init.d/rc.debian.asterisk  "$(DESTDIR)/etc/init.d/asterisk"; \
-                       if [ ! -f "$(DESTDIR)/etc/default/asterisk" ] ; then \
-                               $(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/default/asterisk" ; \
-                       fi ; \
-                       if [ -z "$(DESTDIR)" ] ; then \
-                               /usr/sbin/update-rc.d asterisk defaults 50 91 ; \
-                       fi ; \
-               elif [ -f /etc/gentoo-release ] ; then \
-                       ./build_tools/install_subst contrib/init.d/rc.gentoo.asterisk  "$(DESTDIR)/etc/init.d/asterisk"; \
-                       if [ -z "$(DESTDIR)" ] ; then \
-                               /sbin/rc-update add asterisk default ; \
-                       fi ; \
-               elif [ -f /etc/mandrake-release -o -f /etc/mandriva-release ] ; then \
-                       ./build_tools/install_subst contrib/init.d/rc.mandriva.asterisk  "$(DESTDIR)/etc/rc.d/init.d/asterisk"; \
-                       if [ ! -f /etc/sysconfig/asterisk ] ; then \
-                               $(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/sysconfig/asterisk" ; \
-                       fi ; \
-                       if [ -z "$(DESTDIR)" ] ; then \
-                               /sbin/chkconfig --add asterisk ; \
-                       fi ; \
-               elif [ -f /etc/SuSE-release -o -f /etc/novell-release ] ; then \
-                       ./build_tools/install_subst contrib/init.d/rc.suse.asterisk  "$(DESTDIR)/etc/init.d/asterisk"; \
-                       if [ ! -f /etc/sysconfig/asterisk ] ; then \
-                               $(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/sysconfig/asterisk" ; \
-                       fi ; \
-                       if [ -z "$(DESTDIR)" ] ; then \
-                               /sbin/chkconfig --add asterisk ; \
-                       fi ; \
-               elif [ -f /etc/arch-release -o -f /etc/arch-release ] ; then \
-                       ./build_tools/install_subst contrib/init.d/rc.archlinux.asterisk  "$(DESTDIR)/etc/init.d/asterisk"; \
-               elif [ -d "$(DESTDIR)/Library/LaunchDaemons" ]; then \
-                       if [ ! -f "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.asterisk.plist" ]; then \
-                               ./build_tools/install_subst contrib/init.d/org.asterisk.asterisk.plist "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.asterisk.plist"; \
-                       fi; \
-                       if [ ! -f "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.muted.plist" ]; then \
-                               ./build_tools/install_subst contrib/init.d/org.asterisk.muted.plist "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.muted.plist"; \
-                       fi; \
-               elif [ -f /etc/slackware-version ]; then \
-                       echo "Slackware is not currently supported, although an init script does exist for it."; \
-               else \
-                       echo "We could not install init scripts for your distribution." ; \
-               fi \
+       @if [ -f /etc/redhat-release -o -f /etc/fedora-release ]; then \
+               ./build_tools/install_subst contrib/init.d/rc.redhat.asterisk  "$(DESTDIR)/etc/rc.d/init.d/asterisk"; \
+               if [ ! -f "$(DESTDIR)/etc/sysconfig/asterisk" ] ; then \
+                       $(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/sysconfig/asterisk" ; \
+               fi ; \
+               if [ -z "$(DESTDIR)" ] ; then \
+                       /sbin/chkconfig --add asterisk ; \
+               fi ; \
+       elif [ -f /etc/debian_version ] ; then \
+               ./build_tools/install_subst contrib/init.d/rc.debian.asterisk  "$(DESTDIR)/etc/init.d/asterisk"; \
+               if [ ! -f "$(DESTDIR)/etc/default/asterisk" ] ; then \
+                       $(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/default/asterisk" ; \
+               fi ; \
+               if [ -z "$(DESTDIR)" ] ; then \
+                       /usr/sbin/update-rc.d asterisk defaults 50 91 ; \
+               fi ; \
+       elif [ -f /etc/gentoo-release ] ; then \
+               ./build_tools/install_subst contrib/init.d/rc.gentoo.asterisk  "$(DESTDIR)/etc/init.d/asterisk"; \
+               if [ -z "$(DESTDIR)" ] ; then \
+                       /sbin/rc-update add asterisk default ; \
+               fi ; \
+       elif [ -f /etc/mandrake-release -o -f /etc/mandriva-release ] ; then \
+               ./build_tools/install_subst contrib/init.d/rc.mandriva.asterisk  "$(DESTDIR)/etc/rc.d/init.d/asterisk"; \
+               if [ ! -f /etc/sysconfig/asterisk ] ; then \
+                       $(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/sysconfig/asterisk" ; \
+               fi ; \
+               if [ -z "$(DESTDIR)" ] ; then \
+                       /sbin/chkconfig --add asterisk ; \
+               fi ; \
+       elif [ -f /etc/SuSE-release -o -f /etc/novell-release ] ; then \
+               ./build_tools/install_subst contrib/init.d/rc.suse.asterisk  "$(DESTDIR)/etc/init.d/asterisk"; \
+               if [ ! -f /etc/sysconfig/asterisk ] ; then \
+                       $(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/sysconfig/asterisk" ; \
+               fi ; \
+               if [ -z "$(DESTDIR)" ] ; then \
+                       /sbin/chkconfig --add asterisk ; \
+               fi ; \
+       elif [ -f /etc/arch-release -o -f /etc/arch-release ] ; then \
+               ./build_tools/install_subst contrib/init.d/rc.archlinux.asterisk  "$(DESTDIR)/etc/init.d/asterisk"; \
+       elif [ -d "$(DESTDIR)/Library/LaunchDaemons" ]; then \
+               if [ ! -f "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.asterisk.plist" ]; then \
+                       ./build_tools/install_subst contrib/init.d/org.asterisk.asterisk.plist "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.asterisk.plist"; \
+               fi; \
+               if [ ! -f "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.muted.plist" ]; then \
+                       ./build_tools/install_subst contrib/init.d/org.asterisk.muted.plist "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.muted.plist"; \
+               fi; \
+       elif [ -f /etc/slackware-version ]; then \
+               echo "Slackware is not currently supported, although an init script does exist for it."; \
        else \
-               echo "We could not install init scripts for your operating system." ; \
+               echo "We could not install init scripts for your distribution." ; \
        fi
 
 sounds:
@@ -889,7 +888,7 @@ sounds:
        @[ -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")
 
 $(SUBDIRS_UNINSTALL):
-       +@$(SUBMAKE) -C $(@:-uninstall=) uninstall
+       +@DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" ASTDATADIR="$(ASTDATADIR)" $(SUBMAKE) -C $(@:-uninstall=) uninstall
 
 main-binuninstall:
        +@DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" ASTLIBDIR="$(ASTLIBDIR)" $(SUBMAKE) -C main binuninstall