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