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