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