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