Add micro-http server and abstract manager interface, make snmp not die
[asterisk/asterisk.git] / Makefile
1 #
2 # Asterisk -- A telephony toolkit for Linux.
3
4 # Top level Makefile
5 #
6 # Copyright (C) 1999-2006, Digium, Inc.
7 #
8 # Mark Spencer <markster@digium.com>
9 #
10 # This program is free software, distributed under the terms of
11 # the GNU General Public License
12 #
13
14 .EXPORT_ALL_VARIABLES:
15
16 # Create OPTIONS variable
17 OPTIONS=
18 # If cross compiling, define these to suit
19 # CROSS_COMPILE=/opt/montavista/pro/devkit/arm/xscale_be/bin/xscale_be-
20 # CROSS_COMPILE_BIN=/opt/montavista/pro/devkit/arm/xscale_be/bin/
21 # CROSS_COMPILE_TARGET=/opt/montavista/pro/devkit/arm/xscale_be/target
22 CC=$(CROSS_COMPILE)gcc
23 HOST_CC=gcc
24 # CROSS_ARCH=Linux
25 # CROSS_PROC=arm
26 # SUB_PROC=xscale # or maverick
27
28 ifeq ($(CROSS_COMPILE),)
29   OSARCH=$(shell uname -s)
30   OSREV=$(shell uname -r)
31 else
32   OSARCH=$(CROSS_ARCH)
33   OSREV=$(CROSS_REV)
34 endif
35
36 PWD=$(shell pwd)
37
38 # Remember the MAKELEVEL at the top
39 MAKETOPLEVEL?=$(MAKELEVEL)
40
41 ifneq ($(findstring dont-optimize,$(MAKECMDGOALS)),dont-optimize)
42 ######### More GSM codec optimization
43 ######### Uncomment to enable MMXTM optimizations for x86 architecture CPU's
44 ######### which support MMX instructions.  This should be newer pentiums,
45 ######### ppro's, etc, as well as the AMD K6 and K7.  
46 #K6OPT  = -DK6OPT
47
48 #Tell gcc to optimize the code
49 OPTIMIZE+=-O6
50 else
51   # Stack backtraces, while useful for debugging, are incompatible with optimizations
52   ifeq (${OSARCH},Linux)
53     CFLAGS+=-DSTACK_BACKTRACES
54   endif
55 endif
56
57 #Overwite config files on "make samples"
58 OVERWRITE=y
59
60 #Include debug and macro symbols in the executables (-g) and profiling info (-pg)
61 DEBUG=-g3 #-pg
62
63 #Set NOCRYPTO to yes if you do not want to have crypto support or 
64 #dependencies
65 #NOCRYPTO=yes
66
67 # If you are running a radio application, define RADIO_RELAX so that the DTMF
68 # will be received more reliably
69 #OPTIONS += -DRADIO_RELAX
70
71 # If you don't have a lot of memory (e.g. embedded Asterisk), define LOW_MEMORY
72 # to reduce the size of certain static buffers
73
74 #ifneq ($(CROSS_COMPILE),)
75 #OPTIONS += -DLOW_MEMORY
76 #endif
77
78 #
79 # Asterisk SMDI integration
80 #
81 WITH_SMDI = 1
82
83 # Optional debugging parameters
84 DEBUG_THREADS = #-DDUMP_SCHEDULER #-DDEBUG_SCHEDULER #-DDEBUG_THREADS #-DDO_CRASH #-DDETECT_DEADLOCKS
85
86 # Uncomment next one to enable ast_frame tracing (for debugging)
87 TRACE_FRAMES = #-DTRACE_FRAMES
88
89 # Uncomment next one to enable malloc debugging
90 # You can view malloc debugging with:
91 #   *CLI> show memory allocations [filename]
92 #   *CLI> show memory summary [filename]
93 #
94 MALLOC_DEBUG = #-include $(PWD)/include/asterisk/astmm.h
95
96 # Where to install asterisk after compiling
97 # Default -> leave empty
98 INSTALL_PREFIX?=
99
100 # Staging directory
101 # Files are copied here temporarily during the install process
102 # For example, make DESTDIR=/tmp/asterisk woud put things in
103 # /tmp/asterisk/etc/asterisk
104 # XXX watch out, put no spaces or comments after the value
105 DESTDIR?=
106 #DESTDIR?=/tmp/asterisk
107
108 # Original busydetect routine
109 BUSYDETECT = #-DBUSYDETECT
110
111 # Improved busydetect routine, comment the previous one if you use this one
112 BUSYDETECT+= #-DBUSYDETECT_MARTIN 
113 # Detect the busy signal looking only at tone lengths
114 # For example if you have 3 beeps 100ms tone, 100ms silence separated by 500 ms of silence
115 BUSYDETECT+= #-DBUSYDETECT_TONEONLY
116 # Enforce the detection of busy signal (get rid of false hangups)
117 # Don't use together with -DBUSYDETECT_TONEONLY
118 BUSYDETECT+= #-DBUSYDETECT_COMPARE_TONE_AND_SILENCE
119
120 ifneq ($(OSARCH),SunOS)
121   ASTLIBDIR=$(INSTALL_PREFIX)/usr/lib/asterisk
122   ASTVARLIBDIR=$(INSTALL_PREFIX)/var/lib/asterisk
123   ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk
124   ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
125   ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
126   ASTHEADERDIR=$(INSTALL_PREFIX)/usr/include/asterisk
127   ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
128   ASTBINDIR=$(INSTALL_PREFIX)/usr/bin
129   ASTSBINDIR=$(INSTALL_PREFIX)/usr/sbin
130   ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
131   ASTMANDIR=$(INSTALL_PREFIX)/usr/share/man
132   MODULES_DIR=$(ASTLIBDIR)/modules
133   AGI_DIR=$(ASTVARLIBDIR)/agi-bin
134 else
135   ASTLIBDIR=$(INSTALL_PREFIX)/opt/asterisk/lib
136   ASTVARLIBDIR=$(INSTALL_PREFIX)/var/opt/asterisk/lib
137   ASTETCDIR=$(INSTALL_PREFIX)/etc/opt/asterisk
138   ASTSPOOLDIR=$(INSTALL_PREFIX)/var/opt/asterisk/spool
139   ASTLOGDIR=$(INSTALL_PREFIX)/var/opt/asterisk/log
140   ASTHEADERDIR=$(INSTALL_PREFIX)/opt/asterisk/usr/include/asterisk
141   ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
142   ASTBINDIR=$(INSTALL_PREFIX)/opt/asterisk/usr/bin
143   ASTSBINDIR=$(INSTALL_PREFIX)/opt/asterisk/usr/sbin
144   ASTVARRUNDIR=$(INSTALL_PREFIX)/var/opt/asterisk/run
145   ASTMANDIR=$(INSTALL_PREFIX)/opt/asterisk/usr/share/man
146   MODULES_DIR=$(ASTLIBDIR)/modules
147   AGI_DIR=$(ASTVARLIBDIR)/agi-bin
148 endif
149
150 ASTCFLAGS=
151
152 # Define this to use files larger than 2GB (useful for sound files longer than 37 hours and logfiles)
153 ASTCFLAGS+=-D_FILE_OFFSET_BITS=64
154
155 # Pentium Pro Optimize
156 #PROC=i686
157
158 # Pentium & VIA processors optimize
159 #PROC=i586
160
161 #PROC=k6
162 #PROC=ppc
163
164 #Uncomment this to use the older DSP routines
165 #ASTCFLAGS+=-DOLD_DSP_ROUTINES
166
167 # Determine by a grep 'DocumentRoot' of your httpd.conf file
168 HTTP_DOCSDIR=/var/www/html
169 # Determine by a grep 'ScriptAlias' of your httpd.conf file
170 HTTP_CGIDIR=/var/www/cgi-bin
171
172 # If the file .asterisk.makeopts is present in your home directory, you can
173 # include all of your favorite Makefile options so that every time you download
174 # a new version of Asterisk, you don't have to edit the makefile to set them. 
175 # The file, /etc/asterisk.makeopts will also be included, but can be overridden
176 # by the file in your home directory.
177
178 ifneq ($(wildcard /etc/asterisk.makeopts),)
179   include /etc/asterisk.makeopts
180 endif
181
182 ifneq ($(wildcard ~/.asterisk.makeopts),)
183   include ~/.asterisk.makeopts
184 endif
185
186 ifeq ($(OSARCH),Linux)
187   ifeq ($(CROSS_COMPILE),)
188     PROC?=$(shell uname -m)
189   else
190     PROC=$(CROSS_PROC)
191   endif
192
193   ifeq ($(PROC),x86_64)
194     # You must have GCC 3.4 to use k8, otherwise use athlon
195     PROC=k8
196     #PROC=athlon
197     OPTIONS+=-m64
198   endif
199
200   ifeq ($(PROC),sparc64)
201     #The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
202     #This works for even old (2.96) versions of gcc and provides a small boost either way.
203     #A ultrasparc cpu is really v9 but the stock debian stable 3.0 gcc doesn't support it.
204     #So we go lowest common available by gcc and go a step down, still a step up from
205     #the default as we now have a better instruction set to work with. - Belgarath
206     PROC=ultrasparc
207     OPTIONS+=$(shell if $(CC) -mtune=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mtune=$(PROC)"; fi)
208     OPTIONS+=$(shell if $(CC) -mcpu=v8 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mcpu=v8"; fi)
209     OPTIONS+=-fomit-frame-pointer
210   endif
211
212   ifeq ($(PROC),arm)
213     # The Cirrus logic is the only heavily shipping arm processor with a real floating point unit
214     ifeq ($(SUB_PROC),maverick)
215       OPTIONS+=-fsigned-char -mcpu=ep9312
216     else
217       ifeq ($(SUB_PROC),xscale)
218         OPTIONS+=-fsigned-char -msoft-float -mcpu=xscale
219       else
220         OPTIONS+=-fsigned-char -msoft-float 
221       endif
222     endif
223   endif
224   MPG123TARG=linux
225 endif
226
227 GREP=grep
228 ID=id
229
230 ifeq ($(OSARCH),SunOS)
231   GREP=/usr/xpg4/bin/grep
232   M4=/usr/local/bin/m4
233   ID=/usr/xpg4/bin/id
234 endif
235
236 INCLUDE+=-Iinclude -I../include
237 ASTCFLAGS+=-pipe  -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
238 ASTCFLAGS+=$(OPTIMIZE)
239 ASTCFLAGS+=# -Werror -Wunused
240 ifeq ($(shell gcc -v 2>&1 | grep 'gcc version' | cut -f3 -d' ' | cut -f1 -d.),4)
241 ASTCFLAGS+= -Wno-pointer-sign
242 endif
243 ASTOBJ=-o asterisk
244
245 ifeq ($(findstring BSD,$(OSARCH)),BSD)
246   PROC=$(shell uname -m)
247   ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
248 endif
249
250 ifneq ($(PROC),ultrasparc)
251   ASTCFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
252 endif
253
254 ifeq ($(PROC),ppc)
255   ASTCFLAGS+=-fsigned-char
256 endif
257
258 ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/osp/osp.h),)
259   ASTCFLAGS+=-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)/usr/local/include/osp
260 else
261   ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
262     ASTCFLAGS+=-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)/usr/include/osp
263   endif
264 endif
265
266 ifeq ($(OSARCH),FreeBSD)
267   BSDVERSION=$(shell make -V OSVERSION -f $(CROSS_COMPILE_TARGET)/usr/share/mk/bsd.port.subdir.mk)
268   ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
269   LIBS+=$(shell if test  $(BSDVERSION) -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
270   ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/spandsp),)
271     ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/spandsp
272   endif
273   MPG123TARG=freebsd
274
275   # XXX FreeBSD paths
276   PREFIX?=/usr/local
277   ASTLIBDIR=$(INSTALL_PREFIX)$(PREFIX)/lib/asterisk
278   ASTVARLIBDIR=$(INSTALL_PREFIX)$(PREFIX)/share/asterisk
279   ASTETCDIR=$(INSTALL_PREFIX)$(PREFIX)/etc/asterisk
280   ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
281   ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
282   ASTHEADERDIR=$(INSTALL_PREFIX)$(PREFIX)/include/asterisk
283   ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
284   ASTBINDIR=$(INSTALL_PREFIX)$(PREFIX)/bin
285   ASTSBINDIR=$(INSTALL_PREFIX)$(PREFIX)/sbin
286   ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
287   ASTMANDIR=$(INSTALL_PREFIX)$(PREFIX)/man
288   # XXX end FreeBSD paths
289
290 endif # FreeBSD
291
292 ifeq ($(OSARCH),NetBSD)
293   ASTCFLAGS+=-pthread
294   INCLUDE+=-I$(CROSS_COMPILE_TARGET)/usr/pkg/include
295   MPG123TARG=netbsd
296 endif
297
298 ifeq ($(OSARCH),OpenBSD)
299   ASTCFLAGS+=-pthread
300 endif
301
302 ifeq ($(OSARCH),SunOS)
303   ASTCFLAGS+=-Wcast-align -DSOLARIS
304   INCLUDE+=-Iinclude/solaris-compat -I$(CROSS_COMPILE_TARGET)/usr/local/ssl/include
305 endif
306
307 ifeq ($(findstring CYGWIN,$(OSARCH)),CYGWIN)
308   CYGLOADER=cygwin_a
309   OSARCH=CYGWIN
310   ASTOBJ=-shared -o asterisk.dll -Wl,--out-implib=libasterisk.dll.a -Wl,--export-all-symbols
311   ASTLINK=
312   LIBS+=-lpthread -lncurses -lm -lresolv
313   ASTSBINDIR=$(MODULES_DIR)
314   PROC=$(shell uname -m)
315 endif
316
317 ifndef WITHOUT_ZAPTEL
318
319 ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
320   ASTCFLAGS+=-DZAPTEL_OPTIMIZATIONS
321 endif
322
323 endif # WITHOUT_ZAPTEL
324
325 LIBEDIT=editline/libedit.a
326
327 ifneq ($(wildcard .version),)
328   ASTERISKVERSION:=$(shell cat .version)
329   ASTERISKVERSIONNUM:=$(shell awk -F. '{printf "%02d%02d%02d", $$1, $$2, $$3}' .version)
330   RPMVERSION:=$(shell sed 's/[-\/:]/_/g' .version)
331 else
332   RPMVERSION=unknown
333 endif
334
335 # CVS mirrors of SVN have .svnrevision files showing
336 # which SVN revision they are based on, and .svnbranch
337 # showing the branch they are made from
338 ifneq ($(wildcard .svnrevision),)
339   ASTERISKVERSIONNUM=999999
340   ASTERISKVERSION:=SVN-$(shell cat .svnbranch)-r$(shell cat .svnrevision)
341 else
342   ifneq ($(wildcard .svn),)
343     ASTERISKVERSIONNUM=999999
344     ASTERISKVERSION=SVN-$(shell build_tools/make_svn_branch_name)
345   endif
346 endif
347
348 ASTCFLAGS+= $(DEBUG_THREADS)
349 ASTCFLAGS+= $(TRACE_FRAMES)
350 ASTCFLAGS+= $(MALLOC_DEBUG)
351 ASTCFLAGS+= $(BUSYDETECT)
352 ASTCFLAGS+= $(OPTIONS)
353 ifneq ($(findstring dont-optimize,$(MAKECMDGOALS)),dont-optimize)
354 ASTCFLAGS+= -fomit-frame-pointer 
355 endif
356
357 SUBDIRS=res channels pbx apps codecs formats agi cdr funcs utils stdtime
358
359 OBJS=io.o sched.o logger.o frame.o loader.o config.o channel.o \
360         translate.o file.o pbx.o cli.o md5.o term.o \
361         ulaw.o alaw.o callerid.o fskmodem.o image.o app.o \
362         cdr.o tdd.o acl.o rtp.o udptl.o manager.o asterisk.o \
363         dsp.o chanvars.o indications.o autoservice.o db.o privacy.o \
364         astmm.o enum.o srv.o dns.o aescrypt.o aestab.o aeskey.o \
365         utils.o plc.o jitterbuf.o dnsmgr.o devicestate.o \
366         netsock.o slinfactory.o ast_expr2.o ast_expr2f.o \
367         cryptostub.o sha1.o http.o
368
369 # we need to link in the objects statically, not as a library, because
370 # otherwise modules will not have them available if none of the static
371 # objects use it.
372 OBJS+= stdtime/localtime.o
373
374 # At the moment say.o is an optional component which can be overridden
375 # by a module.
376 OBJS+= say.o
377
378 ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/sys/poll.h),)
379   OBJS+= poll.o
380   ASTCFLAGS+=-DPOLLCOMPAT
381 endif
382
383 ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/dlfcn.h),)
384   OBJS+= dlfcn.o
385   ASTCFLAGS+=-DDLFCNCOMPAT
386 endif
387
388 ifeq ($(OSARCH),Linux)
389   LIBS+=-ldl -lpthread -lncurses -lm -lresolv  #-lnjamd
390 else
391   LIBS+=-lncurses -lm
392 endif
393
394 ifeq ($(OSARCH),Darwin)
395   LIBS+=-lresolv
396   ASTCFLAGS+=-D__Darwin__
397   AUDIO_LIBS=-framework CoreAudio
398   ASTLINK=-Wl,-dynamic
399   SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace
400   OBJS+=poll.o
401   ASTCFLAGS+=-DPOLLCOMPAT
402 else
403 #These are used for all but Darwin
404   ASTLINK=-Wl,-E 
405   SOLINK=-shared -Xlinker -x
406   ifeq ($(findstring BSD,$(OSARCH)),BSD)
407     SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
408   endif
409 endif
410
411 ifeq ($(OSARCH),FreeBSD)
412   LIBS+=-lcrypto
413 endif
414
415 ifeq ($(OSARCH),NetBSD)
416   LIBS+=-lpthread -lcrypto -lm -L$(CROSS_COMPILE_TARGET)/usr/pkg/lib -lncurses
417 endif
418
419 ifeq ($(OSARCH),OpenBSD)
420   LIBS+=-lcrypto -lpthread -lm -lncurses
421 endif
422
423 ifeq ($(OSARCH),SunOS)
424   LIBS+=-lpthread -ldl -lnsl -lsocket -lresolv -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib
425   OBJS+=strcompat.o
426   ASTLINK=
427   SOLINK=-shared -fpic -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib
428 endif
429
430 ifeq ($(MAKETOPLEVEL),$(MAKELEVEL))
431   CFLAGS+=$(ASTCFLAGS)
432 endif
433
434 # This is used when generating the doxygen documentation
435 ifneq ($(wildcard /usr/local/bin/dot)$(wildcard /usr/bin/dot),)
436   HAVEDOT=yes
437 else
438   HAVEDOT=no
439 endif
440
441 INSTALL=install
442
443 CFLAGS+=-DT38_SUPPORT
444
445 _all: all
446         @echo " +--------- Asterisk Build Complete ---------+"  
447         @echo " + Asterisk has successfully been built, but +"  
448         @echo " + cannot be run before being installed by   +"  
449         @echo " + running:                                  +"  
450         @echo " +                                           +"
451         @echo " +               $(MAKE) install                +"  
452         @echo " +-------------------------------------------+"  
453
454 all: cleantest depend asterisk subdirs 
455
456 #ifneq ($(wildcard tags),)
457 ctags: tags
458 #endif
459
460 ifneq ($(wildcard TAGS),)
461 all: TAGS
462 endif
463
464 noclean: depend asterisk subdirs
465
466 editline/config.h:
467         cd editline && unset CFLAGS LIBS && ./configure ; \
468
469 editline/libedit.a: FORCE
470         cd editline && unset CFLAGS LIBS && test -f config.h || ./configure
471         $(MAKE) -C editline libedit.a
472
473 db1-ast/libdb1.a: FORCE
474         $(MAKE) -C db1-ast libdb1.a
475
476 ifneq ($(wildcard .depend),)
477   include .depend
478 endif
479
480 ifneq ($(wildcard .tags-depend),)
481   include .tags-depend
482 endif
483
484 ast_expr2.c:
485         bison -d --name-prefix=ast_yy ast_expr2.y -o ast_expr2.c
486
487 ast_expr2f.c:
488         flex --full ast_expr2.fl
489
490 testexpr2: ast_expr2f.c ast_expr2.c ast_expr2.h
491         gcc -g -c -DSTANDALONE ast_expr2f.c
492         gcc -g -c -DSTANDALONE ast_expr2.c
493         gcc -g -o testexpr2 ast_expr2f.o ast_expr2.o
494         rm ast_expr2.o ast_expr2f.o 
495
496 manpage: asterisk.8
497
498 asterisk.8: asterisk.sgml
499         rm -f asterisk.8
500         docbook2man asterisk.sgml
501         mv ./*.8 asterisk.8
502
503 asterisk.pdf: asterisk.sgml
504         docbook2pdf asterisk.sgml
505
506 asterisk.ps: asterisk.sgml
507         docbook2ps asterisk.sgml
508
509 asterisk.html: asterisk.sgml
510         docbook2html asterisk.sgml
511         mv r1.html asterisk.html
512
513 asterisk.txt: asterisk.sgml
514         docbook2txt asterisk.sgml
515
516 defaults.h: FORCE
517         build_tools/make_defaults_h > $@.tmp
518         if cmp -s $@.tmp $@ ; then echo ; else \
519                 mv $@.tmp $@ ; \
520         fi
521         rm -f $@.tmp
522
523 include/asterisk/version.h: FORCE
524         build_tools/make_version_h > $@.tmp
525         if cmp -s $@.tmp $@ ; then echo; else \
526                 mv $@.tmp $@ ; \
527         fi
528         rm -f $@.tmp
529
530 stdtime/libtime.a: FORCE
531         $(MAKE) -C stdtime libtime.a
532
533 cygwin_a:
534         $(MAKE) -C cygwin all
535
536 asterisk: $(CYGLOADER) editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
537         build_tools/make_build_h > include/asterisk/build.h.tmp
538         if cmp -s include/asterisk/build.h.tmp include/asterisk/build.h ; then echo ; else \
539                 mv include/asterisk/build.h.tmp include/asterisk/build.h ; \
540         fi
541         rm -f include/asterisk/build.h.tmp
542         $(CC) -c -o buildinfo.o $(CFLAGS) buildinfo.c
543         $(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a $(LIBS)
544
545 muted: muted.o
546         $(CC) $(AUDIO_LIBS) -o muted muted.o
547
548 subdirs: 
549         for x in $(SUBDIRS); do $(MAKE) -C $$x || exit 1 ; done
550
551 clean-depend:
552         for x in $(SUBDIRS); do $(MAKE) -C $$x clean-depend || exit 1 ; done
553         rm -f .depend .tags-depend
554
555 clean: clean-depend
556         for x in $(SUBDIRS); do $(MAKE) -C $$x clean || exit 1 ; done
557         rm -f *.o *.so asterisk
558         rm -f defaults.h
559         rm -f include/asterisk/build.h
560         rm -f include/asterisk/version.h
561         rm -f .tags-sources tags TAGS
562         @if [ -f editline/Makefile ]; then $(MAKE) -C editline distclean ; fi
563         @if [ -d mpg123-0.59r ]; then $(MAKE) -C mpg123-0.59r clean; fi
564         $(MAKE) -C db1-ast clean
565         $(MAKE) -C stdtime clean
566
567 datafiles: all
568         if [ x`$(ID) -un` = xroot ]; then sh build_tools/mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; fi
569         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         rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/voicemail
678         mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds
679         mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
680         mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-custom
681         mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/keys
682         mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware
683         mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax
684         mkdir -p $(DESTDIR)$(ASTMANDIR)/man8
685         $(INSTALL) -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
686         $(INSTALL) -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
687         $(INSTALL) -m 644 asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
688         $(INSTALL) -m 644 contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8
689         $(INSTALL) -m 644 contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8
690         $(INSTALL) -m 644 contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
691         if [ -d contrib/firmware/iax ]; then \
692                 $(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \
693         else \
694                 echo "You need to do cvs update -d not just cvs update" ; \
695         fi 
696         ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds  ; ln -s $(ASTSPOOLDIR)/voicemail . )
697         if [ -f mpg123-0.59r/mpg123 ]; then $(MAKE) -C mpg123-0.59r install; fi
698         @echo " +---- Asterisk Installation Complete -------+"  
699         @echo " +                                           +"
700         @echo " +    YOU MUST READ THE SECURITY DOCUMENT    +"
701         @echo " +                                           +"
702         @echo " + Asterisk has successfully been installed. +"  
703         @echo " + If you would like to install the sample   +"  
704         @echo " + configuration files (overwriting any      +"
705         @echo " + existing config files), run:              +"  
706         @echo " +                                           +"
707         @echo " +               $(MAKE) samples                +"
708         @echo " +                                           +"
709         @echo " +-----------------  or ---------------------+"
710         @echo " +                                           +"
711         @echo " + You can go ahead and install the asterisk +"
712         @echo " + program documentation now or later run:   +"
713         @echo " +                                           +"
714         @echo " +              $(MAKE) progdocs                +"
715         @echo " +                                           +"
716         @echo " + **Note** This requires that you have      +"
717         @echo " + doxygen installed on your local system    +"
718         @echo " +-------------------------------------------+"
719         @$(MAKE) -s oldmodcheck
720
721 NEWMODS=$(notdir $(wildcard */*.so))
722 OLDMODS=$(filter-out $(NEWMODS),$(notdir $(wildcard $(DESTDIR)$(MODULES_DIR)/*.so)))
723
724 oldmodcheck:
725         @if [ -n "$(OLDMODS)" ]; then \
726                 echo " WARNING WARNING WARNING" ;\
727                 echo "" ;\
728                 echo " Your Asterisk modules directory, located at" ;\
729                 echo " $(DESTDIR)$(MODULES_DIR)" ;\
730                 echo " contains modules that were not installed by this " ;\
731                 echo " version of Asterisk. Please ensure that these" ;\
732                 echo " modules are compatible with this version before" ;\
733                 echo " attempting to run Asterisk." ;\
734                 echo "" ;\
735                 for f in $(OLDMODS); do \
736                         echo "    $$f" ;\
737                 done ;\
738                 echo "" ;\
739                 echo " WARNING WARNING WARNING" ;\
740         fi
741
742 install: all datafiles bininstall
743         @if [ -x /usr/sbin/asterisk-post-install ]; then \
744                 /usr/sbin/asterisk-post-install $(DESTDIR) . ; \
745         fi
746
747 upgrade: all bininstall
748
749 adsi:
750         mkdir -p $(DESTDIR)$(ASTETCDIR)
751         for x in configs/*.adsi; do \
752                 if [ ! -f $(DESTDIR)$(ASTETCDIRX)/$$x ]; then \
753                         $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
754                 fi ; \
755         done
756
757 samples: adsi
758         mkdir -p $(DESTDIR)$(ASTETCDIR)
759         for x in configs/*.sample; do \
760                 if [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
761                         if [ "$(OVERWRITE)" = "y" ]; then \
762                                 if cmp -s $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $$x ; then \
763                                         echo "Config file $$x is unchanged"; \
764                                         continue; \
765                                 fi ; \
766                                 mv -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample`.old ; \
767                         else \
768                                 echo "Skipping config file $$x"; \
769                                 continue; \
770                         fi ;\
771                 fi ; \
772                 $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
773         done
774         if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
775                 ( \
776                 echo "[directories]" ; \
777                 echo "astetcdir => $(ASTETCDIR)" ; \
778                 echo "astmoddir => $(MODULES_DIR)" ; \
779                 echo "astvarlibdir => $(ASTVARLIBDIR)" ; \
780                 echo "astagidir => $(AGI_DIR)" ; \
781                 echo "astspooldir => $(ASTSPOOLDIR)" ; \
782                 echo "astrundir => $(ASTVARRUNDIR)" ; \
783                 echo "astlogdir => $(ASTLOGDIR)" ; \
784                 echo "" ; \
785                 echo "; Changing the following lines may compromise your security." ; \
786                 echo ";[files]" ; \
787                 echo ";astctlpermissions = 0660" ; \
788                 echo ";astctlowner = root" ; \
789                 echo ";astctlgroup = apache" ; \
790                 echo ";astctl = asterisk.ctl" ; \
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
958 uninstall-all: _uninstall
959         rm -rf $(DESTDIR)$(ASTLIBDIR)
960         rm -rf $(DESTDIR)$(ASTVARLIBDIR)
961         rm -rf $(DESTDIR)$(ASTSPOOLDIR)
962         rm -rf $(DESTDIR)$(ASTETCDIR)
963         rm -rf $(DESTDIR)$(ASTLOGDIR)
964