Add peercontext parameter for default outbound context (bug #1929)
[asterisk/asterisk.git] / Makefile
1 #
2 # Asterisk -- A telephony toolkit for Linux.
3
4 # Top level Makefile
5 #
6 # Copyright (C) 1999, Mark Spencer
7 #
8 # Mark Spencer <markster@linux-support.net>
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 OSARCH=$(shell uname -s)
20
21 ifeq (${OSARCH},Linux)
22 PROC=$(shell uname -m)
23 ifeq ($(PROC),x86_64)
24 # You must have GCC 3.4 to use k8, otherwise use athlon
25 PROC=k8
26 #PROC=athlon
27 OPTIONS+=-m64
28 endif
29 endif
30
31 ifeq ($(findstring BSD,${OSARCH}),BSD)
32 PROC=$(shell uname -m)
33 endif
34
35 # Pentium Pro Optimize
36 #PROC=i686
37
38 # Pentium & VIA processors optimize
39 #PROC=i586
40
41 #PROC=k6
42 #PROC=ppc
43
44 PWD=$(shell pwd)
45
46 ######### More GSM codec optimization
47 ######### Uncomment to enable MMXTM optimizations for x86 architecture CPU's
48 ######### which support MMX instructions.  This should be newer pentiums,
49 ######### ppro's, etc, as well as the AMD K6 and K7.  
50 #K6OPT  = -DK6OPT
51
52 #Tell gcc to optimize the asterisk's code
53 OPTIMIZE=-O6
54
55 #Include debug symbols in the executables (-g) and profiling info (-pg)
56 DEBUG=-g #-pg
57
58 # If you are running a radio application, define RADIO_RELAX so that the DTMF
59 # will be received more reliably
60 #OPTIONS += -DRADIO_RELAX
61
62 # If you don't have a lot of memory (e.g. embedded Asterisk), uncomment the
63 # following to reduce the size of certain static buffers
64 #OPTIONS += -DLOW_MEMORY
65
66 # Optional debugging parameters
67 DEBUG_THREADS = #-DDEBUG_THREADS #-DDO_CRASH 
68
69 # Uncomment next one to enable ast_frame tracing (for debugging)
70 TRACE_FRAMES = #-DTRACE_FRAMES
71
72 # Uncomment next one to enable malloc debugging
73 # You can view malloc debugging with:
74 #   *CLI> show memory allocations [filename]
75 #   *CLI> show memory summary [filename]
76 #
77 MALLOC_DEBUG = #-include $(PWD)/include/asterisk/astmm.h
78
79 # Where to install asterisk after compiling
80 # Default -> leave empty
81 INSTALL_PREFIX=
82
83 # Staging directory
84 # Files are copied here temporarily during the install process
85 # For example, make DESTDIR=/tmp/asterisk woud put things in
86 # /tmp/asterisk/etc/asterisk
87 DESTDIR=
88
89 # Original busydetect routine
90 BUSYDETECT = #-DBUSYDETECT
91
92 # Improved busydetect routine, comment the previous one if you use this one
93 BUSYDETECT+= -DBUSYDETECT_MARTIN 
94 # Detect the busy signal looking only at tone lengths
95 # For example if you have 3 beeps 100ms tone, 100ms silence separated by 500 ms of silence
96 BUSYDETECT+= #-DBUSYDETECT_TONEONLY
97 # Inforce the detection of busy singal (get rid of false hangups)
98 # Don't use together with -DBUSYDETECT_TONEONLY
99 BUSYDETECT+= #-DBUSYDETECT_COMPARE_TONE_AND_SILENCE
100
101 ASTLIBDIR=$(INSTALL_PREFIX)/usr/lib/asterisk
102 ASTVARLIBDIR=$(INSTALL_PREFIX)/var/lib/asterisk
103 ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk
104 ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
105 ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
106 ASTHEADERDIR=$(INSTALL_PREFIX)/usr/include/asterisk
107 ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
108 ASTBINDIR=$(INSTALL_PREFIX)/usr/bin
109 ASTSBINDIR=$(INSTALL_PREFIX)/usr/sbin
110 ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
111
112 MODULES_DIR=$(ASTLIBDIR)/modules
113 AGI_DIR=$(ASTVARLIBDIR)/agi-bin
114
115 INCLUDE=-Iinclude -I../include
116 CFLAGS=-pipe  -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
117 CFLAGS+=$(OPTIMIZE)
118 CFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
119 CFLAGS+=$(shell if uname -m | grep -q ppc; then echo "-fsigned-char"; fi)
120 CFLAGS+=$(shell if [ -f /usr/include/osp/osp.h ]; then echo "-DOSP_SUPPORT -I/usr/include/osp" ; fi)
121
122 ifeq (${OSARCH},FreeBSD)
123 OSVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
124 CFLAGS+=$(if ${OSVERSION}<500016,-D_THREAD_SAFE)
125 LIBS+=$(if ${OSVERSION}<502102,-lc_r,-pthread)
126 INCLUDE+=-I/usr/local/include
127 CFLAGS+=$(shell if [ -d /usr/local/include/spandsp ]; then echo "-I/usr/local/include/spandsp"; fi)
128 endif # FreeBSD
129
130 ifeq (${OSARCH},OpenBSD)
131 CFLAGS+=-pthread
132 endif
133
134 #Uncomment this to use the older DSP routines
135 #CFLAGS+=-DOLD_DSP_ROUTINES
136
137 CFLAGS+=$(shell if [ -f /usr/include/linux/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi)
138 CFLAGS+=$(shell if [ -f /usr/local/include/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi)
139
140 LIBEDIT=editline/libedit.a
141
142 ASTERISKVERSION=$(shell if [ -f .version ]; then cat .version; else if [ -d CVS ]; then if [ -f CVS/Tag ] ; then echo "CVS-`sed 's/^T//g' CVS/Tag`-`date +"%D-%T"`"; else echo "CVS-HEAD-`date +"%D-%T"`"; fi; fi; fi)
143 HTTPDIR=$(shell if [ -d /var/www ]; then echo "/var/www"; else echo "/home/httpd"; fi)
144 RPMVERSION=$(shell if [ -f .version ]; then sed 's/[-\/:]/_/g' .version; else echo "unknown" ; fi)
145 CFLAGS+=-DASTERISK_VERSION=\"$(ASTERISKVERSION)\"
146 CFLAGS+=-DINSTALL_PREFIX=\"$(INSTALL_PREFIX)\"
147 CFLAGS+=-DASTETCDIR=\"$(ASTETCDIR)\"
148 CFLAGS+=-DASTLIBDIR=\"$(ASTLIBDIR)\"
149 CFLAGS+=-DASTVARLIBDIR=\"$(ASTVARLIBDIR)\"
150 CFLAGS+=-DASTVARRUNDIR=\"$(ASTVARRUNDIR)\"
151 CFLAGS+=-DASTSPOOLDIR=\"$(ASTSPOOLDIR)\"
152 CFLAGS+=-DASTLOGDIR=\"$(ASTLOGDIR)\"
153 CFLAGS+=-DASTCONFPATH=\"$(ASTCONFPATH)\"
154 CFLAGS+=-DASTMODDIR=\"$(MODULES_DIR)\"
155 CFLAGS+=-DASTAGIDIR=\"$(AGI_DIR)\"
156
157 CFLAGS+= $(DEBUG_THREADS)
158 CFLAGS+= $(TRACE_FRAMES)
159 CFLAGS+= $(MALLOC_DEBUG)
160 CFLAGS+= $(BUSYDETECT)
161 CFLAGS+= $(OPTIONS)
162 CFLAGS+=# -fomit-frame-pointer 
163 SUBDIRS=res channels pbx apps codecs formats agi cdr astman stdtime
164 ifeq (${OSARCH},Linux)
165 LIBS=-ldl -lpthread
166 endif
167 LIBS+=-lncurses -lm
168 ifeq (${OSARCH},Linux)
169 LIBS+=-lresolv  #-lnjamd
170 endif
171 ifeq (${OSARCH},Darwin)
172 LIBS+=-lresolv
173 endif
174 ifeq (${OSARCH},FreeBSD)
175 LIBS+=-lcrypto
176 endif
177 LIBS+=-lssl
178 OBJS=io.o sched.o logger.o frame.o loader.o config.o channel.o \
179         translate.o file.o say.o pbx.o cli.o md5.o term.o \
180         ulaw.o alaw.o callerid.o fskmodem.o image.o app.o \
181         cdr.o tdd.o acl.o rtp.o manager.o asterisk.o ast_expr.o \
182         dsp.o chanvars.o indications.o autoservice.o db.o privacy.o \
183         astmm.o enum.o srv.o dns.o aescrypt.o aestab.o aeskey.o \
184         utils.o 
185 ifeq (${OSARCH},Darwin)
186 OBJS+=poll.o dlfcn.o
187 ASTLINK=-Wl,-dynamic
188 SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace
189 else
190 ASTLINK=-Wl,-E 
191 SOLINK=-shared -Xlinker -x
192 endif
193
194 CC=gcc
195 INSTALL=install
196
197 _all: all
198         @echo " +--------- Asterisk Build Complete ---------+"  
199         @echo " + Asterisk has successfully been built, but +"  
200         @echo " + cannot be run before being installed by   +"  
201         @echo " + running:                                  +"  
202         @echo " +                                           +"
203         @echo " +               $(MAKE) install                +"  
204         @echo " +-------------------------------------------+"  
205
206 all: depend asterisk subdirs
207
208 editline/config.h:
209         cd editline && unset CFLAGS LIBS && ./configure ; \
210
211 editline/libedit.a: FORCE
212         cd editline && unset CFLAGS LIBS && test -f config.h || ./configure
213         $(MAKE) -C editline libedit.a
214
215 db1-ast/libdb1.a: FORCE
216         @if [ -d db1-ast ]; then \
217                 $(MAKE) -C db1-ast libdb1.a ; \
218         else \
219                 echo "You need to do a cvs update -d not just cvs update"; \
220                 exit 1; \
221         fi
222
223 ifneq ($(wildcard .depend),)
224 include .depend
225 endif
226
227 .PHONY: _version
228
229 _version: 
230         if [ -d CVS ] && ! [ -f .version ]; then echo $(ASTERISKVERSION) > .version; fi 
231
232 .version: _version
233
234 .y.c:
235         bison $< --name-prefix=ast_yy -o $@
236
237 ast_expr.o: ast_expr.c
238
239 cli.o: cli.c build.h
240
241 asterisk.o: asterisk.c build.h
242
243 ifneq ($(strip $(ASTERISKVERSION)),)
244 build.h: .version
245         ./make_build_h
246 else
247 build.h:
248         ./make_build_h
249 endif
250
251 stdtime/libtime.a: FORCE
252         @if [ -d stdtime ]; then \
253                 $(MAKE) -C stdtime libtime.a ; \
254         else \
255                 echo "You need to do a cvs update -d not just cvs update"; \
256                 exit 1; \
257         fi
258
259 asterisk: editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
260         $(CC) $(DEBUG) -o asterisk $(ASTLINK) $(OBJS) $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a $(LIBS)
261
262 muted: muted.o
263         $(CC) -o muted muted.o
264
265 subdirs: 
266         for x in $(SUBDIRS); do $(MAKE) -C $$x || exit 1 ; done
267
268 clean:
269         for x in $(SUBDIRS); do $(MAKE) -C $$x clean || exit 1 ; done
270         rm -f *.o *.so asterisk .depend
271         rm -f build.h 
272         rm -f ast_expr.c
273         @if [ -e editline/Makefile ]; then $(MAKE) -C editline distclean ; fi
274         $(MAKE) -C db1-ast clean
275         $(MAKE) -C stdtime clean
276
277 datafiles: all
278         mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits
279         for x in sounds/digits/*.gsm; do \
280                 if grep -q "^%`basename $$x`%" sounds.txt; then \
281                         install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
282                 else \
283                         echo "No description for $$x"; \
284                         exit 1; \
285                 fi; \
286         done
287         mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters
288         for x in sounds/letters/*.gsm; do \
289                 if grep -q "^%`basename $$x`%" sounds.txt; then \
290                         install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \
291                 else \
292                         echo "No description for $$x"; \
293                         exit 1; \
294                 fi; \
295         done
296         mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic
297         for x in sounds/phonetic/*.gsm; do \
298                 if grep -q "^%`basename $$x`%" sounds.txt; then \
299                         install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \
300                 else \
301                         echo "No description for $$x"; \
302                         exit 1; \
303                 fi; \
304         done
305         for x in 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-*; do \
306                 if grep -q "^%`basename $$x`%" sounds.txt; then \
307                         install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
308                 else \
309                         echo "No description for $$x"; \
310                         exit 1; \
311                 fi; \
312         done
313         mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/mohmp3
314         mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/images
315         for x in images/*.jpg; do \
316                 install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \
317         done
318         mkdir -p $(DESTDIR)$(AGI_DIR)
319
320 update: 
321         @if [ -d CVS ]; then \
322                 echo "Updating from CVS..." ; \
323                 cvs -q update -Pd; \
324                 rm -f .version; \
325         else \
326                 echo "Not CVS";  \
327         fi
328
329 bininstall: all
330         mkdir -p $(DESTDIR)$(MODULES_DIR)
331         mkdir -p $(DESTDIR)$(ASTSBINDIR)
332         mkdir -p $(DESTDIR)$(ASTETCDIR)
333         mkdir -p $(DESTDIR)$(ASTBINDIR)
334         mkdir -p $(DESTDIR)$(ASTSBINDIR)
335         mkdir -p $(DESTDIR)$(ASTVARRUNDIR)
336         mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail
337         install -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/
338         install -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
339         if [ ! -f $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ]; then \
340                 install -m 755 contrib/scripts/safe_asterisk $(DESTDIR)$(ASTSBINDIR)/ ;\
341         fi
342         for x in $(SUBDIRS); do $(MAKE) -C $$x install || exit 1 ; done
343         install -d $(DESTDIR)$(ASTHEADERDIR)
344         install -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
345         rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/vm
346         rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/voicemail
347         if [ ! -h $(DESTDIR)$(ASTSPOOLDIR)/vm ] && [ -d $(DESTDIR)$(ASTSPOOLDIR)/vm ]; then \
348                 mv $(DESTDIR)$(ASTSPOOLDIR)/vm $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default; \
349         else \
350                 mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default; \
351                 rm -f $(DESTDIR)$(ASTSPOOLDIR)/vm; \
352         fi
353         ln -s $(ASTSPOOLDIR)/voicemail/default $(DESTDIR)$(ASTSPOOLDIR)/vm
354         rm -f $(DESTDIR)$(MODULES_DIR)/chan_ixj.so
355         rm -f $(DESTDIR)$(MODULES_DIR)/chan_tor.so
356         rm -f $(DESTDIR)$(MODULES_DIR)/cdr_mysql.so
357         rm -f $(DESTDIR)$(MODULES_DIR)/cdr_unixodbc.so
358         rm -f $(DESTDIR)$(MODULES_DIR)/codec_mp3_d.so
359         rm -f $(DESTDIR)$(MODULES_DIR)/format_mp3.so
360         rm -f $(DESTDIR)$(MODULES_DIR)/app_voicemail2.so
361         mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds
362         mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
363         mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/keys
364         mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware
365         mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax
366         install -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
367         install -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
368         if [ -d contrib/firmware/iax ]; then \
369                 install -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \
370         else \
371                 echo "You need to do cvs update -d not just cvs update" ; \
372         fi 
373         ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds  ; ln -s $(ASTSPOOLDIR)/vm . )
374         ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds  ; ln -s $(ASTSPOOLDIR)/voicemail . )
375         @echo " +---- Asterisk Installation Complete -------+"  
376         @echo " +                                           +"
377         @echo " +    YOU MUST READ THE SECURITY DOCUMENT    +"
378         @echo " +                                           +"
379         @echo " + Asterisk has successfully been installed. +"  
380         @echo " + If you would like to install the sample   +"  
381         @echo " + configuration files (overwriting any      +"
382         @echo " + existing config files), run:              +"  
383         @echo " +                                           +"
384         @echo " +               $(MAKE) samples                +"
385         @echo " +                                           +"
386         @echo " +-----------------  or ---------------------+"
387         @echo " +                                           +"
388         @echo " + You can go ahead and install the asterisk +"
389         @echo " + program documentation now or later run:   +"
390         @echo " +                                           +"
391         @echo " +              $(MAKE) progdocs                +"
392         @echo " +                                           +"
393         @echo " + **Note** This requires that you have      +"
394         @echo " + doxygen installed on your local system    +"
395         @echo " +-------------------------------------------+"
396
397 install: all datafiles bininstall
398
399 upgrade: all bininstall
400
401 adsi: all
402         mkdir -p $(DESTDIR)$(ASTETCDIR)
403         for x in configs/*.adsi; do \
404                 if ! [ -f $(DESTDIR)$(ASTETCDIRX)/$$x ]; then \
405                         install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
406                 fi ; \
407         done
408
409 samples: all datafiles adsi
410         mkdir -p $(DESTDIR)$(ASTETCDIR)
411         for x in configs/*.sample; do \
412                 if [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
413                         mv -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample`.old ; \
414                 fi ; \
415                 install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
416         done
417         echo "[directories]" > $(DESTDIR)$(ASTETCDIR)/asterisk.conf
418         echo "astetcdir => $(ASTETCDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
419         echo "astmoddir => $(MODULES_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
420         echo "astvarlibdir => $(ASTVARLIBDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
421         echo "astagidir => $(AGI_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
422         echo "astspooldir => $(ASTSPOOLDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
423         echo "astrundir => $(ASTVARRUNDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
424         echo "astlogdir => $(ASTLOGDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
425         for x in sounds/demo-*; do \
426                 if grep -q "^%`basename $$x`%" sounds.txt; then \
427                         install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
428                 else \
429                         echo "No description for $$x"; \
430                         exit 1; \
431                 fi; \
432         done
433         for x in sounds/*.mp3; do \
434                 install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
435         done
436         mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX
437         :> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm
438         for x in vm-theperson digits/1 digits/2 digits/3 digits/4 vm-isunavail; do \
439                 cat $(DESTDIR)$(ASTVARLIBDIR)/sounds/$$x.gsm >> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm ; \
440         done
441         :> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/busy.gsm
442         for x in vm-theperson digits/1 digits/2 digits/3 digits/4 vm-isonphone; do \
443                 cat $(DESTDIR)$(ASTVARLIBDIR)/sounds/$$x.gsm >> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/busy.gsm ; \
444         done
445
446 webvmail:
447         @[ -d $(DESTDIR)$(HTTPDIR) ] || ( echo "No HTTP directory" && exit 1 )
448         @[ -d $(DESTDIR)$(HTTPDIR)/html ] || ( echo "No http directory" && exit 1 )
449         @[ -d $(DESTDIR)$(HTTPDIR)/cgi-bin ] || ( echo "No cgi-bin directory" && exit 1 )
450         install -m 4755 -o root -g root contrib/scripts/vmail.cgi $(DESTDIR)$(HTTPDIR)/cgi-bin/vmail.cgi
451         mkdir -p $(DESTDIR)$(HTTPDIR)/html/_asterisk
452         for x in images/*.gif; do \
453                 install -m 644 $$x $(DESTDIR)$(HTTPDIR)/html/_asterisk/; \
454         done
455         @echo " +--------- Asterisk Web Voicemail ----------+"  
456         @echo " +                                           +"
457         @echo " + Asterisk Web Voicemail is installed in    +"
458         @echo " + your cgi-bin directory.  IT USES A SETUID +"
459         @echo " + ROOT PERL SCRIPT, SO IF YOU DON'T LIKE    +"
460         @echo " + THAT, UNINSTALL IT!                       +"
461         @echo " +                                           +"
462         @echo " +-------------------------------------------+"  
463
464 mailbox:
465         ./contrib/scripts/addmailbox 
466
467 rpm: __rpm
468
469 __rpm: _version
470         rm -rf /tmp/asterisk ; \
471         mkdir -p /tmp/asterisk/redhat/RPMS/i386 ; \
472         $(MAKE) DESTDIR=/tmp/asterisk install ; \
473         $(MAKE) DESTDIR=/tmp/asterisk samples ; \
474         mkdir -p /tmp/asterisk/etc/rc.d/init.d ; \
475         cp -f redhat/asterisk /tmp/asterisk/etc/rc.d/init.d/ ; \
476         sed "s/^Version:.*/Version: $(RPMVERSION)/g" redhat/asterisk.spec > asterisk.spec ; \
477         rpmbuild --rcfile /usr/lib/rpm/rpmrc:redhat/rpmrc -bb asterisk.spec
478
479 progdocs:
480         doxygen contrib/asterisk-ng-doxygen
481
482 config:
483         if [ -d /etc/rc.d/init.d ]; then \
484                 install -m 755 contrib/init.d/rc.redhat.asterisk /etc/rc.d/init.d/asterisk; \
485                 /sbin/chkconfig --add asterisk; \
486         elif [ -d /etc/init.d ]; then \
487                 install -m 755 init.asterisk /etc/init.d/asterisk; \
488         fi 
489
490 dont-optimize:
491         $(MAKE) OPTIMIZE= K6OPT= install
492
493 valgrind: dont-optimize
494
495 depend: .depend
496         for x in $(SUBDIRS); do $(MAKE) -C $$x depend || exit 1 ; done
497
498 .depend:
499         ./mkdep ${CFLAGS} `ls *.c`
500
501 FORCE:
502
503 %_env:
504         make -C $(shell echo $@ | sed "s/_env//g") env
505
506 env:
507         env