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