Fix crash in DTMF detection.
[asterisk/asterisk.git] / Makefile
index 7d40208..20b5ecf 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -60,6 +60,7 @@ export ASTBINDIR
 export ASTSBINDIR
 export AGI_DIR
 export ASTCONFPATH
+export ASTKEYDIR
 
 export OSARCH                  # Operating system
 export PROC                    # Processor type
@@ -80,13 +81,14 @@ export CXX
 export AR
 export RANLIB
 export HOST_CC
+export BUILD_CC
 export INSTALL
 export STRIP
 export DOWNLOAD
 export AWK
 export GREP
-export ID
 export MD5
+export WGET_EXTRA_ARGS
 
 # even though we could use '-include makeopts' here, use a wildcard
 # lookup anyway, so that make won't try to build makeopts if it doesn't
@@ -157,6 +159,9 @@ else
   ASTVARLIBDIR=$(localstatedir)/lib/asterisk
   ASTDBDIR=$(ASTVARLIBDIR)
 endif
+ifneq ($(findstring darwin,$(OSARCH)),)
+  ASTVARRUNDIR=/Library/Application Support/Asterisk/Run
+endif
   ASTKEYDIR=$(ASTVARLIBDIR)
 endif
 ifeq ($(ASTDATADIR),)
@@ -174,6 +179,14 @@ HTTP_DOCSDIR=/var/www/html
 # Determine by a grep 'ScriptAlias' of your Apache httpd.conf file
 HTTP_CGIDIR=/var/www/cgi-bin
 
+# If your platform's linker expects a prefix on symbols generated from compiling C
+# source files, set LINKER_SYMBOL_PREFIX to that value. On some systems, exported symbols
+# from C source files are prefixed with '_', for example. If this value is not set
+# properly, the linker scripts that live in the '*.exports' files in various places
+# in this tree will unintentionally suppress symbols that should be visible
+# in the final binary objects.
+LINKER_SYMBOL_PREFIX=
+
 # Uncomment this to use the older DSP routines
 #_ASTCFLAGS+=-DOLD_DSP_ROUTINES
 
@@ -276,7 +289,7 @@ ifeq ($(OSARCH),OpenBSD)
 endif
 
 ifeq ($(OSARCH),SunOS)
-  _ASTCFLAGS+=-Wcast-align -DSOLARIS -I../include/solaris-compat -I/opt/ssl/include -I/usr/local/ssl/include -D_XPG4_2
+  _ASTCFLAGS+=-Wcast-align -DSOLARIS -I../include/solaris-compat -I/opt/ssl/include -I/usr/local/ssl/include -D_XPG4_2 -D__EXTENSIONS__
 endif
 
 ASTERISKVERSION:=$(shell GREP=$(GREP) AWK=$(AWK) build_tools/make_version .)
@@ -305,7 +318,11 @@ MOD_SUBDIRS_MENUSELECT_TREE:=$(MOD_SUBDIRS:%=%-menuselect-tree)
 
 ifneq ($(findstring darwin,$(OSARCH)),)
   _ASTCFLAGS+=-D__Darwin__
-  SOLINK=-bundle -undefined suppress -force_flat_namespace
+  SOLINK=-bundle -Xlinker -macosx_version_min -Xlinker 10.4 -Xlinker -undefined -Xlinker dynamic_lookup -force_flat_namespace
+  ifeq ($(shell /usr/bin/sw_vers -productVersion | cut -c1-4),10.6)
+    SOLINK+=/usr/lib/bundle1.o
+  endif
+  _ASTLDFLAGS+=-L/usr/local/lib
 else
 # These are used for all but Darwin
   SOLINK=-shared
@@ -369,8 +386,11 @@ makeopts: configure
        @echo "****"
        @exit 1
 
-menuselect.makeopts: menuselect/menuselect menuselect-tree makeopts
-       menuselect/menuselect --check-deps menuselect.makeopts $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS)
+menuselect.makeopts: menuselect/menuselect menuselect-tree makeopts build_tools/menuselect-deps $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS)
+ifeq ($(filter %menuselect,$(MAKECMDGOALS)),)
+       menuselect/menuselect --check-deps $@
+       menuselect/menuselect --check-deps $@ $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS)
+endif
 
 $(MOD_SUBDIRS_EMBED_LDSCRIPT):
        +@echo "EMBED_LDSCRIPTS+="`$(SILENTMAKE) -C $(@:-embed-ldscript=) SUBDIR=$(@:-embed-ldscript=) __embed_ldscript` >> makeopts.embed_rules
@@ -413,10 +433,10 @@ res:      main
 endif
 
 $(MOD_SUBDIRS):
-       @_ASTCFLAGS="$(MOD_SUBDIR_CFLAGS) $(_ASTCFLAGS)" ASTCFLAGS="$(ASTCFLAGS)" _ASTLDFLAGS="$(_ASTLDFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" $(SUBMAKE) --no-builtin-rules -C $@ SUBDIR=$@ all
+       +@_ASTCFLAGS="$(MOD_SUBDIR_CFLAGS) $(_ASTCFLAGS)" ASTCFLAGS="$(ASTCFLAGS)" _ASTLDFLAGS="$(_ASTLDFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" $(SUBMAKE) --no-builtin-rules -C $@ SUBDIR=$@ all
 
 $(OTHER_SUBDIRS):
-       @_ASTCFLAGS="$(OTHER_SUBDIR_CFLAGS) $(_ASTCFLAGS)" ASTCFLAGS="$(ASTCFLAGS)" _ASTLDFLAGS="$(_ASTLDFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" $(SUBMAKE) --no-builtin-rules -C $@ SUBDIR=$@ all
+       +@_ASTCFLAGS="$(OTHER_SUBDIR_CFLAGS) $(_ASTCFLAGS)" ASTCFLAGS="$(ASTCFLAGS)" _ASTLDFLAGS="$(_ASTLDFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" $(SUBMAKE) --no-builtin-rules -C $@ SUBDIR=$@ all
 
 defaults.h: makeopts
        @build_tools/make_defaults_h > $@.tmp
@@ -474,7 +494,7 @@ distclean: $(SUBDIRS_DIST_CLEAN) _clean
        rm -f build_tools/menuselect-deps
 
 datafiles: _all
-       if [ x`$(ID) -un` = xroot ]; then CFLAGS="$(_ASTCFLAGS) $(ASTCFLAGS)" bash build_tools/mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; fi
+       CFLAGS="$(_ASTCFLAGS) $(ASTCFLAGS)" build_tools/mkpkgconfig $(DESTDIR)$(libdir)/pkgconfig;
 # Should static HTTP be installed during make samples or even with its own target ala
 # webvoicemail?  There are portions here that *could* be customized but might also be
 # improved a lot.  I'll put it here for now.
@@ -543,7 +563,7 @@ installdirs:
        mkdir -p $(DESTDIR)$(ASTSBINDIR)
        mkdir -p $(DESTDIR)$(ASTETCDIR)
        mkdir -p $(DESTDIR)$(ASTBINDIR)
-       mkdir -p $(DESTDIR)$(ASTVARRUNDIR)
+       mkdir -p "$(DESTDIR)$(ASTVARRUNDIR)"
        mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail
        mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/dictate
        mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/system
@@ -556,7 +576,7 @@ bininstall: _all installdirs $(SUBDIRS_INSTALL)
        $(LN) -sf asterisk $(DESTDIR)$(ASTSBINDIR)/rasterisk
        $(INSTALL) -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
        $(INSTALL) -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
-       if [ ! -f $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ]; then \
+       if [ ! -f $(DESTDIR)$(ASTSBINDIR)/safe_asterisk -a ! -f /sbin/launchd ]; then \
                cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
                chmod 755 $(DESTDIR)$(ASTSBINDIR)/safe_asterisk;\
        fi
@@ -591,7 +611,7 @@ bininstall: _all installdirs $(SUBDIRS_INSTALL)
        fi
 
 $(SUBDIRS_INSTALL):
-       @DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" $(SUBMAKE) -C $(@:-install=) install
+       +@DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" $(SUBMAKE) -C $(@:-install=) install
 
 NEWMODS:=$(foreach d,$(MOD_SUBDIRS),$(notdir $(wildcard $(d)/*.so)))
 OLDMODS=$(filter-out $(NEWMODS),$(notdir $(wildcard $(DESTDIR)$(MODULES_DIR)/*.so)))
@@ -686,69 +706,22 @@ samples: adsi
                echo "Installing file $$x"; \
                $(INSTALL) -m 644 $$x $${dst} ;\
        done
-       @if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
-               echo "Creating asterisk.conf"; \
-               ( \
-               echo "[directories](!) ; remove the (!) to enable this" ; \
-               echo "astetcdir => $(ASTETCDIR)" ; \
-               echo "astmoddir => $(MODULES_DIR)" ; \
-               echo "astvarlibdir => $(ASTVARLIBDIR)" ; \
-               echo "astdbdir => $(ASTDBDIR)" ; \
-               echo "astkeydir => $(ASTKEYDIR)" ; \
-               echo "astdatadir => $(ASTDATADIR)" ; \
-               echo "astagidir => $(AGI_DIR)" ; \
-               echo "astspooldir => $(ASTSPOOLDIR)" ; \
-               echo "astrundir => $(ASTVARRUNDIR)" ; \
-               echo "astlogdir => $(ASTLOGDIR)" ; \
-               echo "" ; \
-               echo "[options]" ; \
-               echo ";verbose = 3" ; \
-               echo ";debug = 3" ; \
-               echo ";alwaysfork = yes ; same as -F at startup" ; \
-               echo ";nofork = yes ; same as -f at startup" ; \
-               echo ";quiet = yes ; same as -q at startup" ; \
-               echo ";timestamp = yes ; same as -T at startup" ; \
-               echo ";execincludes = yes ; support #exec in config files" ; \
-               echo ";console = yes ; Run as console (same as -c at startup)" ; \
-               echo ";highpriority = yes ; Run realtime priority (same as -p at startup)" ; \
-               echo ";initcrypto = yes ; Initialize crypto keys (same as -i at startup)" ; \
-               echo ";nocolor = yes ; Disable console colors" ; \
-               echo ";dontwarn = yes ; Disable some warnings" ; \
-               echo ";dumpcore = yes ; Dump core on crash (same as -g at startup)" ; \
-               echo ";languageprefix = yes ; Use the new sound prefix path syntax" ; \
-               echo ";internal_timing = yes" ; \
-               echo ";systemname = my_system_name ; prefix uniqueid with a system name for global uniqueness issues" ; \
-               echo ";autosystemname = yes ; automatically set systemname to hostname - uses 'localhost' on failure, or systemname if set" ; \
-               echo ";maxcalls = 10 ; Maximum amount of calls allowed" ; \
-               echo ";maxload = 0.9 ; Asterisk stops accepting new calls if the load average exceed this limit" ; \
-               echo ";maxfiles = 1000 ; Maximum amount of openfiles" ; \
-               echo ";minmemfree = 1 ; in MBs, Asterisk stops accepting new calls if the amount of free memory falls below this watermark" ; \
-               echo ";cache_record_files = yes ; Cache recorded sound files to another directory during recording" ; \
-               echo ";record_cache_dir = /tmp ; Specify cache directory (used in cnjunction with cache_record_files)" ; \
-               echo ";transmit_silence_during_record = yes ; Transmit SLINEAR silence while a channel is being recorded" ; \
-               echo ";transmit_silence = yes ; Transmit SLINEAR silence while a channel is being recorded or DTMF is being generated" ; \
-               echo ";transcode_via_sln = yes ; Build transcode paths via SLINEAR, instead of directly" ; \
-               echo ";runuser = asterisk ; The user to run as" ; \
-               echo ";rungroup = asterisk ; The group to run as" ; \
-               echo ";lightbackground = yes ; If your terminal is set for a light-colored background" ; \
-               echo "documentation_language = en_US ; Set the Language you want Documentation displayed in. Value is in the same format as locale names" ; \
-               echo ";hideconnect = yes ; Hide messages displayed when a remote console connects and disconnects" ; \
-               echo "" ; \
-               echo "; Changing the following lines may compromise your security." ; \
-               echo ";[files]" ; \
-               echo ";astctlpermissions = 0660" ; \
-               echo ";astctlowner = root" ; \
-               echo ";astctlgroup = apache" ; \
-               echo ";astctl = asterisk.ctl" ; \
-               echo "" ; \
-               echo "[compat]" ; \
-               echo "pbx_realtime=1.6" ; \
-               echo "res_agi=1.6" ; \
-               echo "app_set=1.6" ; \
-               ) > $(DESTDIR)$(ASTCONFPATH) ; \
-       else \
-               echo "Skipping asterisk.conf creation"; \
-       fi
+       if [ "$(OVERWRITE)" = "y" ]; then \
+               echo "Updating asterisk.conf"; \
+               sed \
+                       -e 's|^astetcdir.*$$|astetcdir => $(ASTETCDIR)|' \
+                       -e 's|^astmoddir.*$$|astmoddir => $(MODULES_DIR)|' \
+                       -e 's|^astvarlibdir.*$$|astvarlibdir => $(ASTVARLIBDIR)|' \
+                       -e 's|^astdbdir.*$$|astdbdir => $(ASTDBDIR)|' \
+                       -e 's|^astkeydir.*$$|astkeydir => $(ASTKEYDIR)|' \
+                       -e 's|^astdatadir.*$$|astdatadir => $(ASTDATADIR)|' \
+                       -e 's|^astagidir.*$$|astagidir => $(AGI_DIR)|' \
+                       -e 's|^astspooldir.*$$|astspooldir => $(ASTSPOOLDIR)|' \
+                       -e 's|^astrundir.*$$|astrundir => $(ASTVARRUNDIR)|' \
+                       -e 's|^astlogdir.*$$|astlogdir => $(ASTLOGDIR)|' \
+                       $(DESTDIR)$(ASTCONFPATH) > $(DESTDIR)$(ASTCONFPATH).tmp \
+                       && mv $(DESTDIR)$(ASTCONFPATH).tmp $(DESTDIR)$(ASTCONFPATH); \
+       fi ;\
        mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX
        build_tools/make_sample_voicemail $(DESTDIR)/$(ASTDATADIR) $(DESTDIR)/$(ASTSPOOLDIR)
        @mkdir -p $(DESTDIR)$(ASTDATADIR)/phoneprov
@@ -813,10 +786,12 @@ config:
                if [ -f /etc/redhat-release -o -f /etc/fedora-release ]; then \
                        cat contrib/init.d/rc.redhat.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR)|;s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)/etc/rc.d/init.d/asterisk ;\
                        chmod 755 $(DESTDIR)/etc/rc.d/init.d/asterisk;\
+                       if [ ! -f /etc/sysconfig/asterisk ]; then install -m 644 contrib/init.d/etc_default_asterisk /etc/sysconfig/asterisk ; fi ;\
                        if [ -z "$(DESTDIR)" ]; then /sbin/chkconfig --add asterisk; fi; \
                elif [ -f /etc/debian_version ]; then \
                        cat contrib/init.d/rc.debian.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR)|;s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)/etc/init.d/asterisk ;\
                        chmod 755 $(DESTDIR)/etc/init.d/asterisk;\
+                       if [ ! -f /etc/default/asterisk ]; then install -m 644 contrib/init.d/etc_default_asterisk /etc/default/asterisk ; fi ;\
                        if [ -z "$(DESTDIR)" ]; then /usr/sbin/update-rc.d asterisk defaults 50 91; fi; \
                elif [ -f /etc/gentoo-release ]; then \
                        cat contrib/init.d/rc.gentoo.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR)|;s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)/etc/init.d/asterisk ;\
@@ -825,14 +800,18 @@ config:
                elif [ -f /etc/mandrake-release -o -f /etc/mandriva-release ]; then \
                        cat contrib/init.d/rc.mandriva.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR)|;s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)/etc/rc.d/init.d/asterisk ;\
                        chmod 755 $(DESTDIR)/etc/rc.d/init.d/asterisk;\
+                       if [ ! -f /etc/sysconfig/asterisk ]; then install -m 644 contrib/init.d/etc_default_asterisk /etc/sysconfig/asterisk ; fi ;\
                        if [ -z "$(DESTDIR)" ]; then /sbin/chkconfig --add asterisk; fi; \
                elif [ -f /etc/SuSE-release -o -f /etc/novell-release ]; then \
                        cat contrib/init.d/rc.suse.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR)|;s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)/etc/init.d/asterisk ;\
                        chmod 755 $(DESTDIR)/etc/init.d/asterisk;\
+                       if [ ! -f /etc/sysconfig/asterisk ]; then install -m 644 contrib/init.d/etc_default_asterisk /etc/sysconfig/asterisk ; fi ;\
                        if [ -z "$(DESTDIR)" ]; then /sbin/chkconfig --add asterisk; fi; \
                elif [ -f /etc/arch-release -o -f /etc/arch-release ]; then \
                        cat contrib/init.d/rc.archlinux.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR)|;s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)/etc/rc.d/asterisk ;\
                        chmod 755 $(DESTDIR)/etc/rc.d/asterisk;\
+               elif [ -d $(DESTDIR)/Library/LaunchDaemons -a ! -f $(DESTDIR)/Library/LaunchDaemons/org.asterisk.asterisk.plist ]; then \
+                       $(INSTALL) -m 644 contrib/init.d/org.asterisk.asterisk.plist $(DESTDIR)/Library/LaunchDaemons/org.asterisk.asterisk.plist; \
                elif [ -f /etc/slackware-version ]; then \
                        echo "Slackware is not currently supported, although an init script does exist for it."; \
                else \
@@ -853,7 +832,7 @@ cleantest:
        @cmp -s .cleancount .lastclean || $(MAKE) clean
 
 $(SUBDIRS_UNINSTALL):
-       @$(SUBMAKE) -C $(@:-uninstall=) uninstall
+       +@$(SUBMAKE) -C $(@:-uninstall=) uninstall
 
 _uninstall: $(SUBDIRS_UNINSTALL)
        rm -f $(DESTDIR)$(MODULES_DIR)/*
@@ -911,17 +890,17 @@ menuselect: menuselect/cmenuselect menuselect/nmenuselect menuselect/gmenuselect
                echo "'make menuselect'."; \
        fi
 
-cmenuselect: menuselect/cmenuselect menuselect-tree
-       -@menuselect/cmenuselect menuselect.makeopts $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
+cmenuselect: menuselect/cmenuselect menuselect-tree menuselect.makeopts
+       -@menuselect/cmenuselect menuselect.makeopts && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
 
-gmenuselect: menuselect/gmenuselect menuselect-tree
-       -@menuselect/gmenuselect menuselect.makeopts $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
+gmenuselect: menuselect/gmenuselect menuselect-tree menuselect.makeopts
+       -@menuselect/gmenuselect menuselect.makeopts && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
 
-nmenuselect: menuselect/nmenuselect menuselect-tree
-       -@menuselect/nmenuselect menuselect.makeopts $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
+nmenuselect: menuselect/nmenuselect menuselect-tree menuselect.makeopts
+       -@menuselect/nmenuselect menuselect.makeopts && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
 
 # options for make in menuselect/
-MAKE_MENUSELECT=CC="$(HOST_CC)" CXX="$(CXX)" LD="" AR="" RANLIB="" CFLAGS="" $(MAKE) -C menuselect CONFIGURE_SILENT="--silent"
+MAKE_MENUSELECT=CC="$(BUILD_CC)" CXX="" LD="" AR="" RANLIB="" CFLAGS="" $(MAKE) -C menuselect CONFIGURE_SILENT="--silent"
 
 menuselect/menuselect: menuselect/makeopts
        +$(MAKE_MENUSELECT) menuselect
@@ -938,7 +917,7 @@ menuselect/nmenuselect: menuselect/makeopts
 menuselect/makeopts: makeopts
        +$(MAKE_MENUSELECT) makeopts
 
-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
+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 utils/utils.xml agi/agi.xml configure
        @echo "Generating input for menuselect ..."
        @echo "<?xml version=\"1.0\"?>" > $@
        @echo >> $@
@@ -949,6 +928,8 @@ menuselect-tree: $(foreach dir,$(filter-out main,$(MOD_SUBDIRS)),$(wildcard $(di
        @if [ "${AST_DEVMODE}" = "yes" ]; then \
                cat build_tools/cflags-devmode.xml >> $@; \
        fi
+       @cat utils/utils.xml >> $@
+       @cat agi/agi.xml >> $@
        @cat build_tools/embed_modules.xml >> $@
        @cat sounds/sounds.xml >> $@
        @echo "</menu>" >> $@
@@ -957,7 +938,36 @@ pdf: asterisk.pdf
 asterisk.pdf:
        $(MAKE) -C doc/tex asterisk.pdf
 
-.PHONY: menuselect menuselect.makeopts main sounds clean dist-clean distclean all prereqs cleantest uninstall _uninstall uninstall-all pdf dont-optimize $(SUBDIRS_INSTALL) $(SUBDIRS_DIST_CLEAN) $(SUBDIRS_CLEAN) $(SUBDIRS_UNINSTALL) $(SUBDIRS) $(MOD_SUBDIRS_EMBED_LDSCRIPT) $(MOD_SUBDIRS_EMBED_LDFLAGS) $(MOD_SUBDIRS_EMBED_LIBS) badshell installdirs validate-docs _clean
+txt: asterisk.txt
+asterisk.txt:
+       $(MAKE) -C doc/tex asterisk.txt
+
+.PHONY: menuselect
+.PHONY: main
+.PHONY: sounds
+.PHONY: clean
+.PHONY: dist-clean
+.PHONY: distclean
+.PHONY: all
+.PHONY: prereqs
+.PHONY: cleantest
+.PHONY: uninstall
+.PHONY: _uninstall
+.PHONY: uninstall-all
+.PHONY: pdf
+.PHONY: dont-optimize
+.PHONY: badshell
+.PHONY: installdirs
+.PHONY: validate-docs
+.PHONY: _clean
+.PHONY: $(SUBDIRS_INSTALL)
+.PHONY: $(SUBDIRS_DIST_CLEAN)
+.PHONY: $(SUBDIRS_CLEAN)
+.PHONY: $(SUBDIRS_UNINSTALL)
+.PHONY: $(SUBDIRS)
+.PHONY: $(MOD_SUBDIRS_EMBED_LDSCRIPT)
+.PHONY: $(MOD_SUBDIRS_EMBED_LDFLAGS)
+.PHONY: $(MOD_SUBDIRS_EMBED_LIBS)
 
 FORCE: