9c058fae4cf4763c6b6e8149682fa759137d3245
[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 .EXPORT_ALL_VARIABLES:
15
16 # Create OPTIONS variable
17 OPTIONS=
18 # If cross compiling, define these to suit
19 # CROSS_COMPILE=/opt/montavista/pro/devkit/arm/xscale_be/bin/xscale_be-
20 # CROSS_COMPILE_BIN=/opt/montavista/pro/devkit/arm/xscale_be/bin/
21 # CROSS_COMPILE_TARGET=/opt/montavista/pro/devkit/arm/xscale_be/target
22 CC=$(CROSS_COMPILE)gcc
23 HOST_CC=gcc
24 # CROSS_ARCH=Linux
25 # CROSS_PROC=arm
26 # SUB_PROC=xscale # or maverick
27
28 ifeq ($(CROSS_COMPILE),)
29   OSARCH=$(shell uname -s)
30   OSREV=$(shell uname -r)
31 else
32   OSARCH=$(CROSS_ARCH)
33   OSREV=$(CROSS_REV)
34 endif
35
36 PWD=$(shell pwd)
37
38 # Remember the MAKELEVEL at the top
39 MAKETOPLEVEL?=$(MAKELEVEL)
40
41 ifneq ($(findstring dont-optimize,$(MAKECMDGOALS)),dont-optimize)
42 ######### More GSM codec optimization
43 ######### Uncomment to enable MMXTM optimizations for x86 architecture CPU's
44 ######### which support MMX instructions.  This should be newer pentiums,
45 ######### ppro's, etc, as well as the AMD K6 and K7.  
46 #K6OPT  = -DK6OPT
47
48 #Tell gcc to optimize the code
49 OPTIMIZE+=-O6
50 else
51   # Stack backtraces, while useful for debugging, are incompatible with optimizations
52   ifeq (${OSARCH},Linux)
53     CFLAGS+=-DSTACK_BACKTRACES
54   endif
55 endif
56
57 #Overwite config files on "make samples"
58 OVERWRITE=y
59
60 #Include debug and macro symbols in the executables (-g) and profiling info (-pg)
61 DEBUG=-g3 #-pg
62
63 #Set NOCRYPTO to yes if you do not want to have crypto support or 
64 #dependencies
65 #NOCRYPTO=yes
66
67 # If you are running a radio application, define RADIO_RELAX so that the DTMF
68 # will be received more reliably
69 #OPTIONS += -DRADIO_RELAX
70
71 # If you don't have a lot of memory (e.g. embedded Asterisk), define LOW_MEMORY
72 # to reduce the size of certain static buffers
73
74 #ifneq ($(CROSS_COMPILE),)
75 #OPTIONS += -DLOW_MEMORY
76 #endif
77
78 #
79 # Asterisk SMDI integration
80 #
81 WITH_SMDI = 1
82
83 # Optional debugging parameters
84 DEBUG_THREADS = #-DDUMP_SCHEDULER #-DDEBUG_SCHEDULER #-DDEBUG_THREADS #-DDO_CRASH #-DDETECT_DEADLOCKS
85
86 # Uncomment next one to enable ast_frame tracing (for debugging)
87 TRACE_FRAMES = #-DTRACE_FRAMES
88
89 # Uncomment next one to enable malloc debugging
90 # You can view malloc debugging with:
91 #   *CLI> show memory allocations [filename]
92 #   *CLI> show memory summary [filename]
93 #
94 MALLOC_DEBUG = #-include $(PWD)/include/asterisk/astmm.h
95
96 # Where to install asterisk after compiling
97 # Default -> leave empty
98 INSTALL_PREFIX?=
99
100 # Staging directory
101 # Files are copied here temporarily during the install process
102 # For example, make DESTDIR=/tmp/asterisk woud put things in
103 # /tmp/asterisk/etc/asterisk
104 # XXX watch out, put no spaces or comments after the value
105 DESTDIR?=
106 #DESTDIR?=/tmp/asterisk
107
108 # Original busydetect routine
109 BUSYDETECT = #-DBUSYDETECT
110
111 # Improved busydetect routine, comment the previous one if you use this one
112 BUSYDETECT+= #-DBUSYDETECT_MARTIN 
113 # Detect the busy signal looking only at tone lengths
114 # For example if you have 3 beeps 100ms tone, 100ms silence separated by 500 ms of silence
115 BUSYDETECT+= #-DBUSYDETECT_TONEONLY
116 # Enforce the detection of busy signal (get rid of false hangups)
117 # Don't use together with -DBUSYDETECT_TONEONLY
118 BUSYDETECT+= #-DBUSYDETECT_COMPARE_TONE_AND_SILENCE
119
120 ifneq ($(OSARCH),SunOS)
121   ASTLIBDIR=$(INSTALL_PREFIX)/usr/lib/asterisk
122   ASTVARLIBDIR=$(INSTALL_PREFIX)/var/lib/asterisk
123   ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk
124   ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
125   ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
126   ASTHEADERDIR=$(INSTALL_PREFIX)/usr/include/asterisk
127   ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
128   ASTBINDIR=$(INSTALL_PREFIX)/usr/bin
129   ASTSBINDIR=$(INSTALL_PREFIX)/usr/sbin
130   ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
131   ASTMANDIR=$(INSTALL_PREFIX)/usr/share/man
132   MODULES_DIR=$(ASTLIBDIR)/modules
133   AGI_DIR=$(ASTVARLIBDIR)/agi-bin
134 else
135   ASTLIBDIR=$(INSTALL_PREFIX)/opt/asterisk/lib
136   ASTVARLIBDIR=$(INSTALL_PREFIX)/var/opt/asterisk/lib
137   ASTETCDIR=$(INSTALL_PREFIX)/etc/opt/asterisk
138   ASTSPOOLDIR=$(INSTALL_PREFIX)/var/opt/asterisk/spool
139   ASTLOGDIR=$(INSTALL_PREFIX)/var/opt/asterisk/log
140   ASTHEADERDIR=$(INSTALL_PREFIX)/opt/asterisk/usr/include/asterisk
141   ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
142   ASTBINDIR=$(INSTALL_PREFIX)/opt/asterisk/usr/bin
143   ASTSBINDIR=$(INSTALL_PREFIX)/opt/asterisk/usr/sbin
144   ASTVARRUNDIR=$(INSTALL_PREFIX)/var/opt/asterisk/run
145   ASTMANDIR=$(INSTALL_PREFIX)/opt/asterisk/usr/share/man
146   MODULES_DIR=$(ASTLIBDIR)/modules
147   AGI_DIR=$(ASTVARLIBDIR)/agi-bin
148 endif
149
150 ASTCFLAGS=
151
152 # Define this to use files larger than 2GB (useful for sound files longer than 37 hours and logfiles)
153 ASTCFLAGS+=-D_FILE_OFFSET_BITS=64
154
155 # Pentium Pro Optimize
156 #PROC=i686
157
158 # Pentium & VIA processors optimize
159 #PROC=i586
160
161 #PROC=k6
162 #PROC=ppc
163
164 #Uncomment this to use the older DSP routines
165 #ASTCFLAGS+=-DOLD_DSP_ROUTINES
166
167 # Determine by a grep 'DocumentRoot' of your httpd.conf file
168 HTTP_DOCSDIR=/var/www/html
169 # Determine by a grep 'ScriptAlias' of your httpd.conf file
170 HTTP_CGIDIR=/var/www/cgi-bin
171
172 # If the file .asterisk.makeopts is present in your home directory, you can
173 # include all of your favorite Makefile options so that every time you download
174 # a new version of Asterisk, you don't have to edit the makefile to set them. 
175 # The file, /etc/asterisk.makeopts will also be included, but can be overridden
176 # by the file in your home directory.
177
178 ifneq ($(wildcard /etc/asterisk.makeopts),)
179   include /etc/asterisk.makeopts
180 endif
181
182 ifneq ($(wildcard ~/.asterisk.makeopts),)
183   include ~/.asterisk.makeopts
184 endif
185
186 ifeq ($(OSARCH),Linux)
187   ifeq ($(CROSS_COMPILE),)
188     PROC?=$(shell uname -m)
189   else
190     PROC=$(CROSS_PROC)
191   endif
192
193   ifeq ($(PROC),x86_64)
194     # You must have GCC 3.4 to use k8, otherwise use athlon
195     PROC=k8
196     #PROC=athlon
197     OPTIONS+=-m64
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 -msoft-float -mcpu=xscale
219       else
220         OPTIONS+=-fsigned-char -msoft-float 
221       endif
222     endif
223   endif
224   MPG123TARG=linux
225 endif
226
227 GREP=grep
228 ID=id
229
230 ifeq ($(OSARCH),SunOS)
231   GREP=/usr/xpg4/bin/grep
232   M4=/usr/local/bin/m4
233   ID=/usr/xpg4/bin/id
234 endif
235
236 INCLUDE+=-Iinclude -I../include
237 ASTCFLAGS+=-pipe  -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
238 ASTCFLAGS+=$(OPTIMIZE)
239 ASTCFLAGS+=# -Werror -Wunused
240 ifeq ($(shell gcc -v 2>&1 | grep 'gcc version' | cut -f3 -d' ' | cut -f1 -d.),4)
241 ASTCFLAGS+= -Wno-pointer-sign
242 endif
243 ASTOBJ=-o asterisk
244
245 ifeq ($(findstring BSD,$(OSARCH)),BSD)
246   PROC=$(shell uname -m)
247   ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
248 endif
249
250 ifneq ($(PROC),ultrasparc)
251   ASTCFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
252 endif
253
254 ifeq ($(PROC),ppc)
255   ASTCFLAGS+=-fsigned-char
256 endif
257
258 ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/osp/osp.h),)
259   ASTCFLAGS+=-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)/usr/local/include/osp
260 else
261   ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
262     ASTCFLAGS+=-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)/usr/include/osp
263   endif
264 endif
265
266 ifeq ($(OSARCH),FreeBSD)
267   BSDVERSION=$(shell make -V OSVERSION -f $(CROSS_COMPILE_TARGET)/usr/share/mk/bsd.port.subdir.mk)
268   ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
269   LIBS+=$(shell if test  $(BSDVERSION) -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
270   ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/spandsp),)
271     ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/spandsp
272   endif
273   MPG123TARG=freebsd
274
275   # XXX FreeBSD paths
276   PREFIX?=/usr/local
277   ASTLIBDIR=$(INSTALL_PREFIX)$(PREFIX)/lib/asterisk
278   ASTVARLIBDIR=$(INSTALL_PREFIX)$(PREFIX)/share/asterisk
279   ASTETCDIR=$(INSTALL_PREFIX)$(PREFIX)/etc/asterisk
280   ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
281   ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
282   ASTHEADERDIR=$(INSTALL_PREFIX)$(PREFIX)/include/asterisk
283   ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
284   ASTBINDIR=$(INSTALL_PREFIX)$(PREFIX)/bin
285   ASTSBINDIR=$(INSTALL_PREFIX)$(PREFIX)/sbin
286   ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
287   ASTMANDIR=$(INSTALL_PREFIX)$(PREFIX)/man
288   # XXX end FreeBSD paths
289
290 endif # FreeBSD
291
292 ifeq ($(OSARCH),NetBSD)
293   ASTCFLAGS+=-pthread
294   INCLUDE+=-I$(CROSS_COMPILE_TARGET)/usr/pkg/include
295   MPG123TARG=netbsd
296 endif
297
298 ifeq ($(OSARCH),OpenBSD)
299   ASTCFLAGS+=-pthread
300 endif
301
302 ifeq ($(OSARCH),SunOS)
303   ASTCFLAGS+=-Wcast-align -DSOLARIS
304   INCLUDE+=-Iinclude/solaris-compat -I$(CROSS_COMPILE_TARGET)/usr/local/ssl/include
305 endif
306
307 ifeq ($(findstring CYGWIN,$(OSARCH)),CYGWIN)
308   CYGLOADER=cygwin_a
309   OSARCH=CYGWIN
310   ASTOBJ=-shared -o asterisk.dll -Wl,--out-implib=libasterisk.dll.a -Wl,--export-all-symbols
311   ASTLINK=
312   LIBS+=-lpthread -lncurses -lm -lresolv
313   ASTSBINDIR=$(MODULES_DIR)
314   PROC=$(shell uname -m)
315 endif
316
317 ifndef WITHOUT_ZAPTEL
318
319 ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
320   ASTCFLAGS+=-DZAPTEL_OPTIMIZATIONS
321 endif
322
323 endif # WITHOUT_ZAPTEL
324
325 LIBEDIT=editline/libedit.a
326
327 ifneq ($(wildcard .version),)
328   ASTERISKVERSION:=$(shell cat .version)
329   ASTERISKVERSIONNUM:=$(shell awk -F. '{printf "%02d%02d%02d", $$1, $$2, $$3}' .version)
330   RPMVERSION:=$(shell sed 's/[-\/:]/_/g' .version)
331 else
332   RPMVERSION=unknown
333 endif
334
335 # CVS mirrors of SVN have .svnrevision files showing
336 # which SVN revision they are based on, and .svnbranch
337 # showing the branch they are made from
338 ifneq ($(wildcard .svnrevision),)
339   ASTERISKVERSIONNUM=999999
340   ASTERISKVERSION:=SVN-$(shell cat .svnbranch)-r$(shell cat .svnrevision)
341 else
342   ifneq ($(wildcard .svn),)
343     ASTERISKVERSIONNUM=999999
344     ASTERISKVERSION=SVN-$(shell build_tools/make_svn_branch_name)
345   endif
346 endif
347
348 ASTCFLAGS+= $(DEBUG_THREADS)
349 ASTCFLAGS+= $(TRACE_FRAMES)
350 ASTCFLAGS+= $(MALLOC_DEBUG)
351 ASTCFLAGS+= $(BUSYDETECT)
352 ASTCFLAGS+= $(OPTIONS)
353 ifneq ($(findstring dont-optimize,$(MAKECMDGOALS)),dont-optimize)
354 ASTCFLAGS+= -fomit-frame-pointer 
355 endif
356
357 SUBDIRS=res channels pbx apps codecs formats agi cdr funcs utils stdtime
358
359 OBJS=io.o sched.o logger.o frame.o loader.o config.o channel.o \
360         translate.o file.o pbx.o cli.o md5.o term.o \
361         ulaw.o alaw.o callerid.o fskmodem.o image.o app.o \
362         cdr.o tdd.o acl.o rtp.o udptl.o manager.o asterisk.o \
363         dsp.o chanvars.o indications.o autoservice.o db.o privacy.o \
364         astmm.o enum.o srv.o dns.o aescrypt.o aestab.o aeskey.o \
365         utils.o plc.o jitterbuf.o dnsmgr.o devicestate.o \
366         netsock.o slinfactory.o ast_expr2.o ast_expr2f.o \
367         cryptostub.o sha1.o http.o
368
369 # we need to link in the objects statically, not as a library, because
370 # otherwise modules will not have them available if none of the static
371 # objects use it.
372 OBJS+= stdtime/localtime.o
373
374 # At the moment say.o is an optional component which can be overridden
375 # by a module.
376 OBJS+= say.o
377
378 ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/sys/poll.h),)
379   OBJS+= poll.o
380   ASTCFLAGS+=-DPOLLCOMPAT
381 endif
382
383 ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/dlfcn.h),)
384   OBJS+= dlfcn.o
385   ASTCFLAGS+=-DDLFCNCOMPAT
386 endif
387
388 ifeq ($(OSARCH),Linux)
389   LIBS+=-ldl -lpthread -lncurses -lm -lresolv  #-lnjamd
390 else
391   LIBS+=-lncurses -lm
392 endif
393
394 ifeq ($(OSARCH),Darwin)
395   LIBS+=-lresolv
396   ASTCFLAGS+=-D__Darwin__
397   AUDIO_LIBS=-framework CoreAudio
398   ASTLINK=-Wl,-dynamic
399   SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace
400   OBJS+=poll.o
401   ASTCFLAGS+=-DPOLLCOMPAT
402 else
403 #These are used for all but Darwin
404   ASTLINK=-Wl,-E 
405   SOLINK=-shared -Xlinker -x
406   ifeq ($(findstring BSD,$(OSARCH)),BSD)
407     SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
408   endif
409 endif
410
411 ifeq ($(OSARCH),FreeBSD)
412   LIBS+=-lcrypto
413 endif
414
415 ifeq ($(OSARCH),NetBSD)
416   LIBS+=-lpthread -lcrypto -lm -L$(CROSS_COMPILE_TARGET)/usr/pkg/lib -lncurses
417 endif
418
419 ifeq ($(OSARCH),OpenBSD)
420   LIBS+=-lcrypto -lpthread -lm -lncurses
421 endif
422
423 ifeq ($(OSARCH),SunOS)
424   LIBS+=-lpthread -ldl -lnsl -lsocket -lresolv -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib
425   OBJS+=strcompat.o
426   ASTLINK=
427   SOLINK=-shared -fpic -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib
428 endif
429
430 ifeq ($(MAKETOPLEVEL),$(MAKELEVEL))
431   CFLAGS+=$(ASTCFLAGS)
432 endif
433
434 # This is used when generating the doxygen documentation
435 ifneq ($(wildcard /usr/local/bin/dot)$(wildcard /usr/bin/dot),)
436   HAVEDOT=yes
437 else
438   HAVEDOT=no
439 endif
440
441 INSTALL=install
442
443 CFLAGS+=-DT38_SUPPORT
444
445 _all: all
446         @echo " +--------- Asterisk Build Complete ---------+"  
447         @echo " + Asterisk has successfully been built, but +"  
448         @echo " + cannot be run before being installed by   +"  
449         @echo " + running:                                  +"  
450         @echo " +                                           +"
451         @echo " +               $(MAKE) install                +"  
452         @echo " +-------------------------------------------+"  
453
454 all: cleantest depend asterisk subdirs 
455
456 #ifneq ($(wildcard tags),)
457 ctags: tags
458 #endif
459
460 ifneq ($(wildcard TAGS),)
461 all: TAGS
462 endif
463
464 noclean: depend asterisk subdirs
465
466 editline/config.h:
467         cd editline && unset CFLAGS LIBS && ./configure ; \
468
469 editline/libedit.a: FORCE
470         cd editline && unset CFLAGS LIBS && test -f config.h || ./configure
471         $(MAKE) -C editline libedit.a
472
473 db1-ast/libdb1.a: FORCE
474         $(MAKE) -C db1-ast libdb1.a
475
476 ifneq ($(wildcard .depend),)
477   include .depend
478 endif
479
480 ifneq ($(wildcard .tags-depend),)
481   include .tags-depend
482 endif
483
484 ast_expr2.c:
485         bison -d --name-prefix=ast_yy ast_expr2.y -o ast_expr2.c
486
487 ast_expr2f.c:
488         flex --full ast_expr2.fl
489
490 testexpr2: ast_expr2f.c ast_expr2.c ast_expr2.h
491         gcc -g -c -DSTANDALONE ast_expr2f.c
492         gcc -g -c -DSTANDALONE ast_expr2.c
493         gcc -g -o testexpr2 ast_expr2f.o ast_expr2.o
494         rm ast_expr2.o ast_expr2f.o 
495
496 manpage: asterisk.8
497
498 asterisk.8: asterisk.sgml
499         rm -f asterisk.8
500         docbook2man asterisk.sgml
501         mv ./*.8 asterisk.8
502
503 asterisk.pdf: asterisk.sgml
504         docbook2pdf asterisk.sgml
505
506 asterisk.ps: asterisk.sgml
507         docbook2ps asterisk.sgml
508
509 asterisk.html: asterisk.sgml
510         docbook2html asterisk.sgml
511         mv r1.html asterisk.html
512
513 asterisk.txt: asterisk.sgml
514         docbook2txt asterisk.sgml
515
516 defaults.h: FORCE
517         build_tools/make_defaults_h > $@.tmp
518         if cmp -s $@.tmp $@ ; then echo ; else \
519                 mv $@.tmp $@ ; \
520         fi
521         rm -f $@.tmp
522
523 include/asterisk/version.h: FORCE
524         build_tools/make_version_h > $@.tmp
525         if cmp -s $@.tmp $@ ; then echo; else \
526                 mv $@.tmp $@ ; \
527         fi
528         rm -f $@.tmp
529
530 stdtime/libtime.a: FORCE
531         $(MAKE) -C stdtime libtime.a
532
533 cygwin_a:
534         $(MAKE) -C cygwin all
535
536 asterisk: $(CYGLOADER) editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
537         build_tools/make_build_h > include/asterisk/build.h.tmp
538         if cmp -s include/asterisk/build.h.tmp include/asterisk/build.h ; then echo ; else \
539                 mv include/asterisk/build.h.tmp include/asterisk/build.h ; \
540         fi
541         rm -f include/asterisk/build.h.tmp
542         $(CC) -c -o buildinfo.o $(CFLAGS) buildinfo.c
543         $(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a $(LIBS)
544
545 muted: muted.o
546         $(CC) $(AUDIO_LIBS) -o muted muted.o
547
548 subdirs: 
549         for x in $(SUBDIRS); do $(MAKE) -C $$x || exit 1 ; done
550
551 clean-depend:
552         for x in $(SUBDIRS); do $(MAKE) -C $$x clean-depend || exit 1 ; done
553         rm -f .depend .tags-depend
554
555 clean: clean-depend
556         for x in $(SUBDIRS); do $(MAKE) -C $$x clean || exit 1 ; done
557         rm -f *.o *.so asterisk
558         rm -f defaults.h
559         rm -f include/asterisk/build.h
560         rm -f include/asterisk/version.h
561         rm -f .tags-sources tags TAGS
562         @if [ -f editline/Makefile ]; then $(MAKE) -C editline distclean ; fi
563         @if [ -d mpg123-0.59r ]; then $(MAKE) -C mpg123-0.59r clean; fi
564         $(MAKE) -C db1-ast clean
565         $(MAKE) -C stdtime clean
566
567 datafiles: all
568         if [ x`$(ID) -un` = xroot ]; then sh build_tools/mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; fi
569         # Should static HTTP be installed during make samples or even with its own target ala
570         # webvoicemail?  There are portions here that *could* be customized but might also be
571         # improved a lot.  I'll put it here for now.
572         mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/static-http
573         for x in static-http/*; do \
574                 install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/static-http ; \
575         done
576         mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits
577         mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/priv-callerintros
578         for x in sounds/digits/*.gsm; do \
579                 if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
580                         $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
581                 else \
582                         echo "No description for $$x"; \
583                         exit 1; \
584                 fi; \
585         done
586         mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate
587         for x in sounds/dictate/*.gsm; do \
588                 if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
589                         $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate ; \
590                 else \
591                         echo "No description for $$x"; \
592                         exit 1; \
593                 fi; \
594         done
595         mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters
596         for x in sounds/letters/*.gsm; do \
597                 if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
598                         $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \
599                 else \
600                         echo "No description for $$x"; \
601                         exit 1; \
602                 fi; \
603         done
604         mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic
605         for x in sounds/phonetic/*.gsm; do \
606                 if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
607                         $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \
608                 else \
609                         echo "No description for $$x"; \
610                         exit 1; \
611                 fi; \
612         done
613         for x in sounds/demo-* sounds/vm-* sounds/transfer* sounds/pbx-* sounds/ss-* sounds/beep* sounds/dir-* sounds/conf-* sounds/agent-* sounds/invalid* sounds/tt-* sounds/auth-* sounds/privacy-* sounds/queue-* sounds/spy-* sounds/priv-* sounds/screen-* sounds/hello-*; do \
614                 if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
615                         $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
616                 else \
617                         echo "No description for $$x"; \
618                         exit 1; \
619                 fi; \
620         done
621         mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/mohmp3
622         mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/images
623         for x in images/*.jpg; do \
624                 $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \
625         done
626         mkdir -p $(DESTDIR)$(AGI_DIR)
627
628 update: 
629         @if [ -d .svn ]; then \
630                 echo "Updating from Subversion..." ; \
631                 svn update | tee update.out; \
632                 rm -f .version; \
633                 if [ `grep -c ^C update.out` -gt 0 ]; then \
634                         echo ; echo "The following files have conflicts:" ; \
635                         grep ^C update.out | cut -b4- ; \
636                 fi ; \
637                 rm -f update.out; \
638                 $(MAKE) clean-depend; \
639         elif [ -d CVS ]; then \
640                 echo "Updating from CVS..." ; \
641                 cvs -q -z3 update -Pd | tee update.out; \
642                 rm -f .version; \
643                 if [ `grep -c ^C update.out` -gt 0 ]; then \
644                         echo ; echo "The following files have conflicts:" ; \
645                         grep ^C update.out | cut -d' ' -f2- ; \
646                 fi ; \
647                 rm -f update.out; \
648                 $(MAKE) clean-depend; \
649         else \
650                 echo "Not under version control";  \
651         fi
652
653 NEWHEADERS=$(notdir $(wildcard include/asterisk/*.h))
654 OLDHEADERS=$(filter-out $(NEWHEADERS),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h)))
655
656 bininstall: all
657         mkdir -p $(DESTDIR)$(MODULES_DIR)
658         mkdir -p $(DESTDIR)$(ASTSBINDIR)
659         mkdir -p $(DESTDIR)$(ASTETCDIR)
660         mkdir -p $(DESTDIR)$(ASTBINDIR)
661         mkdir -p $(DESTDIR)$(ASTVARRUNDIR)
662         mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail
663         mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/dictate
664         mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/system
665         mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/tmp
666         mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/meetme
667         mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/monitor
668         if [ -f asterisk ]; then $(INSTALL) -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/; fi
669         if [ -f cygwin/asterisk.exe ]; then $(INSTALL) -m 755 cygwin/asterisk.exe $(DESTDIR)$(ASTSBINDIR)/; fi
670         if [ -f asterisk.dll ]; then $(INSTALL) -m 755 asterisk.dll $(DESTDIR)$(ASTSBINDIR)/; fi
671         ln -sf asterisk $(DESTDIR)$(ASTSBINDIR)/rasterisk
672         $(INSTALL) -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
673         $(INSTALL) -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/  
674         if [ ! -f $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ]; then \
675                 cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;' > $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
676                 chmod 755 $(DESTDIR)$(ASTSBINDIR)/safe_asterisk;\
677         fi
678         for x in $(SUBDIRS); do $(MAKE) -C $$x install || exit 1 ; done
679         $(INSTALL) -d $(DESTDIR)$(ASTHEADERDIR)
680         $(INSTALL) -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
681         if [ -n "$(OLDHEADERS)" ]; then \
682                 rm -f $(addprefix $(DESTDIR)$(ASTHEADERDIR)/,$(OLDHEADERS)) ;\
683         fi
684         rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/voicemail
685         mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds
686         mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
687         mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-custom
688         mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/keys
689         mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware
690         mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax
691         mkdir -p $(DESTDIR)$(ASTMANDIR)/man8
692         $(INSTALL) -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
693         $(INSTALL) -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
694         $(INSTALL) -m 644 asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
695         $(INSTALL) -m 644 contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8
696         $(INSTALL) -m 644 contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8
697         $(INSTALL) -m 644 contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
698         if [ -d contrib/firmware/iax ]; then \
699                 $(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \
700         else \
701                 echo "You need to do cvs update -d not just cvs update" ; \
702         fi 
703         ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds  ; ln -s $(ASTSPOOLDIR)/voicemail . )
704         if [ -f mpg123-0.59r/mpg123 ]; then $(MAKE) -C mpg123-0.59r install; fi
705         @echo " +---- Asterisk Installation Complete -------+"  
706         @echo " +                                           +"
707         @echo " +    YOU MUST READ THE SECURITY DOCUMENT    +"
708         @echo " +                                           +"
709         @echo " + Asterisk has successfully been installed. +"  
710         @echo " + If you would like to install the sample   +"  
711         @echo " + configuration files (overwriting any      +"
712         @echo " + existing config files), run:              +"  
713         @echo " +                                           +"
714         @echo " +               $(MAKE) samples                +"
715         @echo " +                                           +"
716         @echo " +-----------------  or ---------------------+"
717         @echo " +                                           +"
718         @echo " + You can go ahead and install the asterisk +"
719         @echo " + program documentation now or later run:   +"
720         @echo " +                                           +"
721         @echo " +              $(MAKE) progdocs                +"
722         @echo " +                                           +"
723         @echo " + **Note** This requires that you have      +"
724         @echo " + doxygen installed on your local system    +"
725         @echo " +-------------------------------------------+"
726         @$(MAKE) -s oldmodcheck
727
728 NEWMODS=$(notdir $(wildcard */*.so))
729 OLDMODS=$(filter-out $(NEWMODS),$(notdir $(wildcard $(DESTDIR)$(MODULES_DIR)/*.so)))
730
731 oldmodcheck:
732         @if [ -n "$(OLDMODS)" ]; then \
733                 echo " WARNING WARNING WARNING" ;\
734                 echo "" ;\
735                 echo " Your Asterisk modules directory, located at" ;\
736                 echo " $(DESTDIR)$(MODULES_DIR)" ;\
737                 echo " contains modules that were not installed by this " ;\
738                 echo " version of Asterisk. Please ensure that these" ;\
739                 echo " modules are compatible with this version before" ;\
740                 echo " attempting to run Asterisk." ;\
741                 echo "" ;\
742                 for f in $(OLDMODS); do \
743                         echo "    $$f" ;\
744                 done ;\
745                 echo "" ;\
746                 echo " WARNING WARNING WARNING" ;\
747         fi
748
749 install: all datafiles bininstall
750         @if [ -x /usr/sbin/asterisk-post-install ]; then \
751                 /usr/sbin/asterisk-post-install $(DESTDIR) . ; \
752         fi
753
754 upgrade: all bininstall
755
756 adsi:
757         mkdir -p $(DESTDIR)$(ASTETCDIR)
758         for x in configs/*.adsi; do \
759                 if [ ! -f $(DESTDIR)$(ASTETCDIRX)/$$x ]; then \
760                         $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
761                 fi ; \
762         done
763
764 samples: adsi
765         mkdir -p $(DESTDIR)$(ASTETCDIR)
766         for x in configs/*.sample; do \
767                 if [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
768                         if [ "$(OVERWRITE)" = "y" ]; then \
769                                 if cmp -s $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $$x ; then \
770                                         echo "Config file $$x is unchanged"; \
771                                         continue; \
772                                 fi ; \
773                                 mv -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample`.old ; \
774                         else \
775                                 echo "Skipping config file $$x"; \
776                                 continue; \
777                         fi ;\
778                 fi ; \
779                 $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
780         done
781         if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
782                 ( \
783                 echo "[directories]" ; \
784                 echo "astetcdir => $(ASTETCDIR)" ; \
785                 echo "astmoddir => $(MODULES_DIR)" ; \
786                 echo "astvarlibdir => $(ASTVARLIBDIR)" ; \
787                 echo "astagidir => $(AGI_DIR)" ; \
788                 echo "astspooldir => $(ASTSPOOLDIR)" ; \
789                 echo "astrundir => $(ASTVARRUNDIR)" ; \
790                 echo "astlogdir => $(ASTLOGDIR)" ; \
791                 echo "" ; \
792                 echo "; Changing the following lines may compromise your security." ; \
793                 echo ";[files]" ; \
794                 echo ";astctlpermissions = 0660" ; \
795                 echo ";astctlowner = root" ; \
796                 echo ";astctlgroup = apache" ; \
797                 echo ";astctl = asterisk.ctl" ; \
798                 echo ";[options]" ; \
799                 echo ";internal_timing = yes" ; \
800                 ) > $(DESTDIR)$(ASTCONFPATH) ; \
801         else \
802                 echo "Skipping asterisk.conf creation"; \
803         fi
804         mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
805         for x in sounds/demo-*; do \
806                 if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
807                         $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
808                 else \
809                         echo "No description for $$x"; \
810                         exit 1; \
811                 fi; \
812         done
813         mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
814         for x in sounds/*.mp3; do \
815                 $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
816         done
817         rm -f $(DESTDIR)$(ASTVARLIBDIR)/mohmp3/sample-hold.mp3
818         mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX
819         :> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm
820         for x in vm-theperson digits/1 digits/2 digits/3 digits/4 vm-isunavail; do \
821                 cat $(DESTDIR)$(ASTVARLIBDIR)/sounds/$$x.gsm >> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm ; \
822         done
823         :> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/busy.gsm
824         for x in vm-theperson digits/1 digits/2 digits/3 digits/4 vm-isonphone; do \
825                 cat $(DESTDIR)$(ASTVARLIBDIR)/sounds/$$x.gsm >> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/busy.gsm ; \
826         done
827
828 webvmail:
829         @[ -d $(DESTDIR)$(HTTP_DOCSDIR)/ ] || ( printf "http docs directory not found.\nUpdate assignment of variable HTTP_DOCSDIR in Makefile!\n" && exit 1 )
830         @[ -d $(DESTDIR)$(HTTP_CGIDIR) ] || ( printf "cgi-bin directory not found.\nUpdate assignment of variable HTTP_CGIDIR in Makefile!\n" && exit 1 )
831         $(INSTALL) -m 4755 -o root -g root contrib/scripts/vmail.cgi $(DESTDIR)$(HTTP_CGIDIR)/vmail.cgi
832         mkdir -p $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk
833         for x in images/*.gif; do \
834                 $(INSTALL) -m 644 $$x $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk/; \
835         done
836         @echo " +--------- Asterisk Web Voicemail ----------+"  
837         @echo " +                                           +"
838         @echo " + Asterisk Web Voicemail is installed in    +"
839         @echo " + your cgi-bin directory:                   +"
840         @echo " + $(DESTDIR)$(HTTP_CGIDIR)"
841         @echo " + IT USES A SETUID ROOT PERL SCRIPT, SO     +"
842         @echo " + IF YOU DON'T LIKE THAT, UNINSTALL IT!     +"
843         @echo " +                                           +"
844         @echo " + Other static items have been stored in:   +"
845         @echo " + $(DESTDIR)$(HTTP_DOCSDIR)"
846         @echo " +                                           +"
847         @echo " + If these paths do not match your httpd    +"
848         @echo " + installation, correct the definitions     +"
849         @echo " + in your Makefile of HTTP_CGIDIR and       +"
850         @echo " + HTTP_DOCSDIR                              +"
851         @echo " +                                           +"
852         @echo " +-------------------------------------------+"  
853
854 spec: 
855         sed "s/^Version:.*/Version: $(RPMVERSION)/g" redhat/asterisk.spec > asterisk.spec ; \
856
857 rpm: __rpm
858
859 __rpm: include/asterisk/version.h spec
860         rm -rf /tmp/asterisk ; \
861         mkdir -p /tmp/asterisk/redhat/RPMS/i386 ; \
862         $(MAKE) DESTDIR=/tmp/asterisk install ; \
863         $(MAKE) DESTDIR=/tmp/asterisk samples ; \
864         mkdir -p /tmp/asterisk/etc/rc.d/init.d ; \
865         cp -f contrib/init.d/rc.redhat.asterisk /tmp/asterisk/etc/rc.d/init.d/asterisk ; \
866         rpmbuild --rcfile /usr/lib/rpm/rpmrc:redhat/rpmrc -bb asterisk.spec
867
868 progdocs:
869         (cat contrib/asterisk-ng-doxygen; echo "HAVE_DOT=$(HAVEDOT)"; \
870         echo "PROJECT_NUMBER=$(ASTERISKVERSION)") | doxygen - 
871
872 mpg123:
873         @wget -V >/dev/null || (echo "You need wget" ; false )
874         [ -f mpg123-0.59r.tar.gz ] || wget http://www.mpg123.de/mpg123/mpg123-0.59r.tar.gz
875         [ -d mpg123-0.59r ] || tar xfz mpg123-0.59r.tar.gz
876         $(MAKE) -C mpg123-0.59r $(MPG123TARG)
877
878 config:
879         if [ -d /etc/rc.d/init.d ]; then \
880                 $(INSTALL) -m 755 contrib/init.d/rc.redhat.asterisk /etc/rc.d/init.d/asterisk; \
881                 /sbin/chkconfig --add asterisk; \
882         elif [ -d /etc/init.d ]; then \
883                 $(INSTALL) -m 755 init.asterisk /etc/init.d/asterisk; \
884         fi 
885
886 dont-optimize: install
887
888 valgrind: dont-optimize
889
890 depend: include/asterisk/version.h .depend defaults.h 
891         for x in $(SUBDIRS); do $(MAKE) -C $$x depend || exit 1 ; done
892
893 .depend: include/asterisk/version.h
894         build_tools/mkdep $(CFLAGS) $(wildcard *.c)
895
896 .tags-depend:
897         @echo -n ".tags-depend: " > $@
898         @find . -maxdepth 1 -name \*.c -printf "\t%p \\\\\n" >> $@
899         @find . -maxdepth 1 -name \*.h -printf "\t%p \\\\\n" >> $@
900         @find $(SUBDIRS) -name \*.c -printf "\t%p \\\\\n" >> $@
901         @find $(SUBDIRS) -name \*.h -printf "\t%p \\\\\n" >> $@
902         @find include -name \*.h -printf "\t%p \\\\\n" >> $@
903         @echo >> $@
904
905 .tags-sources:
906         @rm -f $@
907         @find . -maxdepth 1 -name \*.c -print >> $@
908         @find . -maxdepth 1 -name \*.h -print >> $@
909         @find $(SUBDIRS) -name \*.c -print >> $@
910         @find $(SUBDIRS) -name \*.h -print >> $@
911         @find include -name \*.h -print >> $@
912
913 tags: .tags-depend .tags-sources
914         ctags -L .tags-sources -o $@
915
916 ctags: tags
917
918 TAGS: .tags-depend .tags-sources
919         etags -o $@ `cat .tags-sources`
920
921 etags: TAGS
922
923 FORCE:
924
925 %_env:
926         $(MAKE) -C $(shell echo $@ | sed "s/_env//g") env
927
928 env:
929         env
930
931 # If the cleancount has been changed, force a make clean.
932 # .cleancount is the global clean count, and .lastclean is the 
933 # last clean count we had
934 # We can avoid this by making noclean
935
936 cleantest:
937         if cmp -s .cleancount .lastclean ; then echo ; else \
938                 $(MAKE) clean; cp -f .cleancount .lastclean;\
939         fi
940
941 _uninstall:
942         rm -f $(DESTDIR)$(MODULES_DIR)/*
943         rm -f $(DESTDIR)$(ASTSBINDIR)/*asterisk*
944         rm -f $(DESTDIR)$(ASTSBINDIR)/astgenkey
945         rm -f $(DESTDIR)$(ASTSBINDIR)/autosupport
946         rm -rf $(DESTDIR)$(ASTHEADERDIR)
947         rm -rf $(DESTDIR)$(ASTVARLIBDIR)/sounds
948         rm -rf $(DESTDIR)$(ASTVARLIBDIR)/firmware
949         rm -rf $(DESTDIR)$(ASTMANDIR)/man8
950         for x in $(SUBDIRS); do $(MAKE) -C $$x uninstall || exit 1 ; done
951
952 uninstall: _uninstall
953         @echo " +--------- Asterisk Uninstall Complete -----+"  
954         @echo " + Asterisk binaries, sounds, man pages,     +"  
955         @echo " + headers, modules, and firmware builds,    +"  
956         @echo " + have all been uninstalled.                +"  
957         @echo " +                                           +"
958         @echo " + To remove ALL traces of Asterisk,         +"
959         @echo " + including configuration, spool            +"
960         @echo " + directories, and logs, run the following  +"
961         @echo " + command:                                  +"
962         @echo " +                                           +"
963         @echo " +            $(MAKE) uninstall-all             +"  
964         @echo " +-------------------------------------------+"  
965
966
967 uninstall-all: _uninstall
968         rm -rf $(DESTDIR)$(ASTLIBDIR)
969         rm -rf $(DESTDIR)$(ASTVARLIBDIR)
970         rm -rf $(DESTDIR)$(ASTSPOOLDIR)
971         rm -rf $(DESTDIR)$(ASTETCDIR)
972         rm -rf $(DESTDIR)$(ASTLOGDIR)
973