2 # Asterisk -- A telephony toolkit for Linux.
6 # Copyright (C) 1999-2006, Digium, Inc.
8 # Mark Spencer <markster@digium.com>
10 # This program is free software, distributed under the terms of
11 # the GNU General Public License
14 # All Makefiles use the following variables:
16 # ASTCFLAGS - compiler options
17 # ASTLDFLAGS - linker flags (not libraries)
18 # AST_LIBS - libraries to build binaries XXX
19 # LIBS - additional libraries, at top-level for all links,
20 # on a single object just for that object
21 # SOLINK - linker flags used only for creating shared objects (.so files),
22 # used for all .so links
24 # Default values fo ASTCFLAGS and ASTLDFLAGS can be specified in the
25 # environment when running make, as follows:
27 # $ ASTCFLAGS="-Werror" make
30 export ASTERISKVERSION
31 export ASTERISKVERSIONNUM
48 export MENUSELECT_CFLAGS
67 # even though we could use '-include makeopts' here, use a wildcard
68 # lookup anyway, so that make won't try to build makeopts if it doesn't
69 # exist (other rules will force it to be built if needed)
70 ifneq ($(wildcard makeopts),)
74 #Uncomment this to see all build commands instead of 'quiet' output
77 # Create OPTIONS variable
82 # Overwite config files on "make samples"
85 # Include debug and macro symbols in the executables (-g) and profiling info (-pg)
89 # Files are copied here temporarily during the install process
90 # For example, make DESTDIR=/tmp/asterisk woud put things in
91 # /tmp/asterisk/etc/asterisk
92 # !!! Watch out, put no spaces or comments after the value !!!
93 #DESTDIR?=/tmp/asterisk
95 # Define standard directories for various platforms
96 # These apply if they are not redefined in asterisk.conf
97 ifeq ($(OSARCH),SunOS)
98 ASTETCDIR=/var/etc/asterisk
99 ASTLIBDIR=/opt/asterisk/lib
100 ASTVARLIBDIR=/var/opt/asterisk
101 ASTSPOOLDIR=/var/spool/asterisk
102 ASTLOGDIR=/var/log/asterisk
103 ASTHEADERDIR=/opt/asterisk/include
104 ASTBINDIR=/opt/asterisk/bin
105 ASTSBINDIR=/opt/asterisk/sbin
106 ASTVARRUNDIR=/var/run/asterisk
107 ASTMANDIR=/opt/asterisk/man
109 ASTETCDIR=$(sysconfdir)/asterisk
110 ASTLIBDIR=$(libdir)/asterisk
111 ASTHEADERDIR=$(includedir)/asterisk
113 ASTSBINDIR=$(sbindir)
114 ASTSPOOLDIR=$(localstatedir)/spool/asterisk
115 ASTLOGDIR=$(localstatedir)/log/asterisk
116 ASTVARRUNDIR=$(localstatedir)/run
118 ifeq ($(OSARCH),FreeBSD)
119 ASTVARLIBDIR=$(prefix)/share/asterisk
121 ASTVARLIBDIR=$(localstatedir)/lib/asterisk
124 ifeq ($(ASTDATADIR),)
125 ASTDATADIR:=$(ASTVARLIBDIR)
128 # Asterisk.conf is located in ASTETCDIR or by using the -C flag
129 # when starting Asterisk
130 ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
131 MODULES_DIR=$(ASTLIBDIR)/modules
132 AGI_DIR=$(ASTDATADIR)/agi-bin
134 # If you use Apache, you may determine by a grep 'DocumentRoot' of your httpd.conf file
135 HTTP_DOCSDIR=/var/www/html
136 # Determine by a grep 'ScriptAlias' of your Apache httpd.conf file
137 HTTP_CGIDIR=/var/www/cgi-bin
139 # Uncomment this to use the older DSP routines
140 #ASTCFLAGS+=-DOLD_DSP_ROUTINES
142 # If the file .asterisk.makeopts is present in your home directory, you can
143 # include all of your favorite menuselect options so that every time you download
144 # a new version of Asterisk, you don't have to run menuselect to set them.
145 # The file /etc/asterisk.makeopts will also be included but can be overridden
146 # by the file in your home directory.
148 GLOBAL_MAKEOPTS=$(wildcard /etc/asterisk.makeopts)
149 USER_MAKEOPTS=$(wildcard ~/.asterisk.makeopts)
151 MOD_SUBDIR_CFLAGS=-I$(ASTTOPDIR)/include
152 OTHER_SUBDIR_CFLAGS=-I$(ASTTOPDIR)/include
154 ifeq ($(OSARCH),linux-gnu)
155 ifeq ($(PROC),x86_64)
156 # You must have GCC 3.4 to use k8, otherwise use athlon
161 ifeq ($(PROC),sparc64)
162 #The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
163 #This works for even old (2.96) versions of gcc and provides a small boost either way.
164 #A ultrasparc cpu is really v9 but the stock debian stable 3.0 gcc doesn't support it.
165 #So we go lowest common available by gcc and go a step down, still a step up from
166 #the default as we now have a better instruction set to work with. - Belgarath
168 OPTIONS+=$(shell if $(CC) -mtune=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mtune=$(PROC)"; fi)
169 OPTIONS+=$(shell if $(CC) -mcpu=v8 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mcpu=v8"; fi)
170 OPTIONS+=-fomit-frame-pointer
174 # The Cirrus logic is the only heavily shipping arm processor with a real floating point unit
175 ifeq ($(SUB_PROC),maverick)
176 OPTIONS+=-fsigned-char -mcpu=ep9312
178 ifeq ($(SUB_PROC),xscale)
179 OPTIONS+=-fsigned-char -mcpu=xscale
181 OPTIONS+=-fsigned-char
187 ASTCFLAGS+=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG)
189 ASTCFLAGS+=-include $(ASTTOPDIR)/include/asterisk/autoconfig.h
191 ifeq ($(AST_DEVMODE),yes)
192 ASTCFLAGS+=-Werror -Wunused
195 ifneq ($(findstring BSD,$(OSARCH)),)
196 ASTCFLAGS+=-I/usr/local/include
197 ASTLDFLAGS+=-L/usr/local/lib
200 ifneq ($(PROC),ultrasparc)
201 ASTCFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
205 ASTCFLAGS+=-fsigned-char
208 ifeq ($(OSARCH),FreeBSD)
209 # -V is understood by BSD Make, not by GNU make.
210 BSDVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
211 ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
212 AST_LIBS+=$(shell if test $(BSDVERSION) -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
215 ifeq ($(OSARCH),NetBSD)
216 ASTCFLAGS+=-pthread -I/usr/pkg/include
219 ifeq ($(OSARCH),OpenBSD)
223 ifeq ($(OSARCH),SunOS)
224 ASTCFLAGS+=-Wcast-align -DSOLARIS -I../include/solaris-compat -I/opt/ssl/include -I/usr/local/ssl/include
227 ASTERISKVERSION:=$(shell build_tools/make_version .)
229 ifneq ($(wildcard .version),)
230 ASTERISKVERSIONNUM:=$(shell awk -F. '{printf "%01d%02d%02d", $$1, $$2, $$3}' .version)
231 RPMVERSION:=$(shell sed 's/[-\/:]/_/g' .version)
236 ifneq ($(wildcard .svn),)
237 ASTERISKVERSIONNUM=999999
240 ASTCFLAGS+=$(MALLOC_DEBUG)$(BUSYDETECT)$(OPTIONS)
242 MOD_SUBDIRS:=res channels pbx apps codecs formats cdr funcs main
243 OTHER_SUBDIRS:=utils agi
244 SUBDIRS:=$(OTHER_SUBDIRS) $(MOD_SUBDIRS)
245 SUBDIRS_INSTALL:=$(SUBDIRS:%=%-install)
246 SUBDIRS_CLEAN:=$(SUBDIRS:%=%-clean)
247 SUBDIRS_UNINSTALL:=$(SUBDIRS:%=%-uninstall)
248 MOD_SUBDIRS_EMBED_LDSCRIPT:=$(MOD_SUBDIRS:%=%-embed-ldscript)
249 MOD_SUBDIRS_EMBED_LDFLAGS:=$(MOD_SUBDIRS:%=%-embed-ldflags)
250 MOD_SUBDIRS_EMBED_LIBS:=$(MOD_SUBDIRS:%=%-embed-libs)
252 ifneq ($(findstring darwin,$(OSARCH)),)
253 ASTCFLAGS+=-D__Darwin__
254 AUDIO_LIBS=-framework CoreAudio
255 SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace
257 # These are used for all but Darwin
258 SOLINK=-shared -Xlinker -x
259 ifneq ($(findstring BSD,$(OSARCH)),)
260 LDFLAGS+=-L/usr/local/lib
264 ifeq ($(OSARCH),SunOS)
265 SOLINK=-shared -fpic -L/usr/local/ssl/lib
268 # This is used when generating the doxygen documentation
276 @echo " +--------- Asterisk Build Complete ---------+"
277 @echo " + Asterisk has successfully been built, and +"
278 @echo " + can be installed by running: +"
280 @echo " + $(MAKE) install +"
281 @echo " +-------------------------------------------+"
283 _all: cleantest $(SUBDIRS)
287 @echo "**** The configure script must be executed before running '$(MAKE)'."
291 menuselect.makeopts: menuselect/menuselect menuselect-tree
292 menuselect/menuselect --check-deps $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) menuselect.makeopts
294 $(MOD_SUBDIRS_EMBED_LDSCRIPT):
295 @echo "EMBED_LDSCRIPTS+="`$(MAKE) --quiet --no-print-directory -C $(@:-embed-ldscript=) SUBDIR=$(@:-embed-ldscript=) __embed_ldscript` >> makeopts.embed_rules
297 $(MOD_SUBDIRS_EMBED_LDFLAGS):
298 @echo "EMBED_LDFLAGS+="`$(MAKE) --quiet --no-print-directory -C $(@:-embed-ldflags=) SUBDIR=$(@:-embed-ldflags=) __embed_ldflags` >> makeopts.embed_rules
300 $(MOD_SUBDIRS_EMBED_LIBS):
301 @echo "EMBED_LIBS+="`$(MAKE) --quiet --no-print-directory -C $(@:-embed-libs=) SUBDIR=$(@:-embed-libs=) __embed_libs` >> makeopts.embed_rules
303 makeopts.embed_rules: menuselect.makeopts
304 @echo "Generating embedded module rules ..."
306 @$(MAKE) --no-print-directory $(MOD_SUBDIRS_EMBED_LDSCRIPT)
307 @$(MAKE) --no-print-directory $(MOD_SUBDIRS_EMBED_LDFLAGS)
308 @$(MAKE) --no-print-directory $(MOD_SUBDIRS_EMBED_LIBS)
310 $(SUBDIRS): include/asterisk/version.h include/asterisk/build.h include/asterisk/buildopts.h defaults.h makeopts.embed_rules
312 # ensure that all module subdirectories are processed before 'main' during
313 # a parallel build, since if there are modules selected to be embedded the
314 # directories containing them must be completed before the main Asterisk
315 # binary can be built
316 main: $(filter-out main,$(MOD_SUBDIRS))
319 @ASTCFLAGS="$(MOD_SUBDIR_CFLAGS) $(ASTCFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" AST_LIBS="$(AST_LIBS)" $(MAKE) --no-print-directory --no-builtin-rules -C $@ SUBDIR=$@ all
322 @ASTCFLAGS="$(OTHER_SUBDIR_CFLAGS) $(ASTCFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" AUDIO_LIBS="$(AUDIO_LIBS)" $(MAKE) --no-print-directory --no-builtin-rules -C $@ SUBDIR=$@ all
325 @build_tools/make_defaults_h > $@.tmp
326 @if cmp -s $@.tmp $@ ; then : ; else \
331 include/asterisk/version.h:
332 @build_tools/make_version_h > $@.tmp
333 @if cmp -s $@.tmp $@ ; then : ; else \
338 include/asterisk/buildopts.h: menuselect.makeopts
339 @build_tools/make_buildopts_h > $@.tmp
340 @if cmp -s $@.tmp $@ ; then : ; else \
345 include/asterisk/build.h:
346 @build_tools/make_build_h > $@.tmp
347 @if cmp -s $@.tmp $@ ; then : ; else \
353 @$(MAKE) --no-print-directory -C $(@:-clean=) clean
355 clean: $(SUBDIRS_CLEAN)
357 rm -f include/asterisk/build.h
358 rm -f include/asterisk/version.h
359 @$(MAKE) -C menuselect clean
360 cp -f .cleancount .lastclean
362 dist-clean: distclean
365 @$(MAKE) -C menuselect dist-clean
366 @$(MAKE) -C sounds dist-clean
367 rm -f menuselect.makeopts makeopts menuselect-tree menuselect.makedeps
368 rm -f makeopts.embed_rules
369 rm -f config.log config.status
370 rm -rf autom4te.cache
371 rm -f include/asterisk/autoconfig.h
372 rm -f include/asterisk/buildopts.h
374 rm -f build_tools/menuselect-deps
377 if [ x`$(ID) -un` = xroot ]; then CFLAGS="$(ASTCFLAGS)" sh build_tools/mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; fi
378 # Should static HTTP be installed during make samples or even with its own target ala
379 # webvoicemail? There are portions here that *could* be customized but might also be
380 # improved a lot. I'll put it here for now.
381 mkdir -p $(DESTDIR)$(ASTDATADIR)/static-http
382 for x in static-http/*; do \
383 $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/static-http ; \
385 mkdir -p $(DESTDIR)$(ASTDATADIR)/images
386 for x in images/*.jpg; do \
387 $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/images ; \
389 mkdir -p $(DESTDIR)$(AGI_DIR)
390 $(MAKE) -C sounds install
393 @if [ -d .svn ]; then \
394 echo "Updating from Subversion..." ; \
395 svn update | tee update.out; \
397 if [ `grep -c ^C update.out` -gt 0 ]; then \
398 echo ; echo "The following files have conflicts:" ; \
399 grep ^C update.out | cut -b4- ; \
403 echo "Not under version control"; \
406 NEWHEADERS=$(notdir $(wildcard include/asterisk/*.h))
407 OLDHEADERS=$(filter-out $(NEWHEADERS),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h)))
410 mkdir -p $(DESTDIR)$(MODULES_DIR)
411 mkdir -p $(DESTDIR)$(ASTSBINDIR)
412 mkdir -p $(DESTDIR)$(ASTETCDIR)
413 mkdir -p $(DESTDIR)$(ASTBINDIR)
414 mkdir -p $(DESTDIR)$(ASTVARRUNDIR)
415 mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail
416 mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/dictate
417 mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/system
418 mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/tmp
419 mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/meetme
420 mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/monitor
421 $(INSTALL) -m 755 main/asterisk $(DESTDIR)$(ASTSBINDIR)/
422 $(LN) -sf asterisk $(DESTDIR)$(ASTSBINDIR)/rasterisk
423 $(INSTALL) -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
424 $(INSTALL) -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
425 if [ ! -f $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ]; then \
426 cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;' > $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
427 chmod 755 $(DESTDIR)$(ASTSBINDIR)/safe_asterisk;\
429 $(INSTALL) -d $(DESTDIR)$(ASTHEADERDIR)
430 $(INSTALL) -m 644 include/asterisk.h $(DESTDIR)$(includedir)
431 $(INSTALL) -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
432 if [ -n "$(OLDHEADERS)" ]; then \
433 rm -f $(addprefix $(DESTDIR)$(ASTHEADERDIR)/,$(OLDHEADERS)) ;\
435 mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
436 mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-custom
437 mkdir -p $(DESTDIR)$(ASTDATADIR)/keys
438 mkdir -p $(DESTDIR)$(ASTDATADIR)/firmware
439 mkdir -p $(DESTDIR)$(ASTDATADIR)/firmware/iax
440 mkdir -p $(DESTDIR)$(ASTMANDIR)/man8
441 $(INSTALL) -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTDATADIR)/keys
442 $(INSTALL) -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTDATADIR)/keys
443 $(INSTALL) -m 644 doc/asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
444 $(INSTALL) -m 644 contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8
445 $(INSTALL) -m 644 contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8
446 $(INSTALL) -m 644 contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
447 if [ -f contrib/firmware/iax/iaxy.bin ] ; then \
448 $(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTDATADIR)/firmware/iax/iaxy.bin; \
452 @DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" $(MAKE) -C $(@:-install=) install
454 NEWMODS=$(notdir $(wildcard */*.so))
455 OLDMODS=$(filter-out $(NEWMODS),$(notdir $(wildcard $(DESTDIR)$(MODULES_DIR)/*.so)))
458 @if [ -n "$(OLDMODS)" ]; then \
459 echo " WARNING WARNING WARNING" ;\
461 echo " Your Asterisk modules directory, located at" ;\
462 echo " $(DESTDIR)$(MODULES_DIR)" ;\
463 echo " contains modules that were not installed by this " ;\
464 echo " version of Asterisk. Please ensure that these" ;\
465 echo " modules are compatible with this version before" ;\
466 echo " attempting to run Asterisk." ;\
468 for f in $(OLDMODS); do \
472 echo " WARNING WARNING WARNING" ;\
475 install: datafiles bininstall $(SUBDIRS_INSTALL)
476 @if [ -x /usr/sbin/asterisk-post-install ]; then \
477 /usr/sbin/asterisk-post-install $(DESTDIR) . ; \
479 @echo " +---- Asterisk Installation Complete -------+"
481 @echo " + YOU MUST READ THE SECURITY DOCUMENT +"
483 @echo " + Asterisk has successfully been installed. +"
484 @echo " + If you would like to install the sample +"
485 @echo " + configuration files (overwriting any +"
486 @echo " + existing config files), run: +"
488 @echo " + $(MAKE) samples +"
490 @echo " +----------------- or ---------------------+"
492 @echo " + You can go ahead and install the asterisk +"
493 @echo " + program documentation now or later run: +"
495 @echo " + $(MAKE) progdocs +"
497 @echo " + **Note** This requires that you have +"
498 @echo " + doxygen installed on your local system +"
499 @echo " +-------------------------------------------+"
500 @$(MAKE) -s oldmodcheck
505 mkdir -p $(DESTDIR)$(ASTETCDIR)
506 for x in configs/*.adsi; do \
507 if [ ! -f $(DESTDIR)$(ASTETCDIR)/$$x ]; then \
508 $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x` ; \
513 mkdir -p $(DESTDIR)$(ASTETCDIR)
514 for x in configs/*.sample; do \
515 if [ -f $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` ]; then \
516 if [ "$(OVERWRITE)" = "y" ]; then \
517 if cmp -s $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` $$x ; then \
518 echo "Config file $$x is unchanged"; \
521 mv -f $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`.old ; \
523 echo "Skipping config file $$x"; \
527 $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` ;\
529 if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
531 echo "[directories]" ; \
532 echo "astetcdir => $(ASTETCDIR)" ; \
533 echo "astmoddir => $(MODULES_DIR)" ; \
534 echo "astvarlibdir => $(ASTVARLIBDIR)" ; \
535 echo "astdatadir => $(ASTDATADIR)" ; \
536 echo "astagidir => $(AGI_DIR)" ; \
537 echo "astspooldir => $(ASTSPOOLDIR)" ; \
538 echo "astrundir => $(ASTVARRUNDIR)" ; \
539 echo "astlogdir => $(ASTLOGDIR)" ; \
541 echo ";[options]" ; \
542 echo ";internal_timing = yes" ; \
543 echo "; Changing the following lines may compromise your security." ; \
545 echo ";astctlpermissions = 0660" ; \
546 echo ";astctlowner = root" ; \
547 echo ";astctlgroup = apache" ; \
548 echo ";astctl = asterisk.ctl" ; \
549 ) > $(DESTDIR)$(ASTCONFPATH) ; \
551 echo "Skipping asterisk.conf creation"; \
553 mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX
554 build_tools/make_sample_voicemail $(DESTDIR)/$(ASTDATADIR) $(DESTDIR)/$(ASTSPOOLDIR)
557 @[ -d $(DESTDIR)$(HTTP_DOCSDIR)/ ] || ( printf "http docs directory not found.\nUpdate assignment of variable HTTP_DOCSDIR in Makefile!\n" && exit 1 )
558 @[ -d $(DESTDIR)$(HTTP_CGIDIR) ] || ( printf "cgi-bin directory not found.\nUpdate assignment of variable HTTP_CGIDIR in Makefile!\n" && exit 1 )
559 $(INSTALL) -m 4755 -o root -g root contrib/scripts/vmail.cgi $(DESTDIR)$(HTTP_CGIDIR)/vmail.cgi
560 mkdir -p $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk
561 for x in images/*.gif; do \
562 $(INSTALL) -m 644 $$x $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk/; \
564 @echo " +--------- Asterisk Web Voicemail ----------+"
566 @echo " + Asterisk Web Voicemail is installed in +"
567 @echo " + your cgi-bin directory: +"
568 @echo " + $(DESTDIR)$(HTTP_CGIDIR)"
569 @echo " + IT USES A SETUID ROOT PERL SCRIPT, SO +"
570 @echo " + IF YOU DON'T LIKE THAT, UNINSTALL IT! +"
572 @echo " + Other static items have been stored in: +"
573 @echo " + $(DESTDIR)$(HTTP_DOCSDIR)"
575 @echo " + If these paths do not match your httpd +"
576 @echo " + installation, correct the definitions +"
577 @echo " + in your Makefile of HTTP_CGIDIR and +"
578 @echo " + HTTP_DOCSDIR +"
580 @echo " +-------------------------------------------+"
583 sed "s/^Version:.*/Version: $(RPMVERSION)/g" redhat/asterisk.spec > asterisk.spec ; \
587 __rpm: include/asterisk/version.h include/asterisk/buildopts.h spec
588 rm -rf /tmp/asterisk ; \
589 mkdir -p /tmp/asterisk/redhat/RPMS/i386 ; \
590 $(MAKE) DESTDIR=/tmp/asterisk install ; \
591 $(MAKE) DESTDIR=/tmp/asterisk samples ; \
592 mkdir -p /tmp/asterisk/etc/rc.d/init.d ; \
593 cp -f contrib/init.d/rc.redhat.asterisk /tmp/asterisk/etc/rc.d/init.d/asterisk ; \
594 rpmbuild --rcfile /usr/lib/rpm/rpmrc:redhat/rpmrc -bb asterisk.spec
597 (cat contrib/asterisk-ng-doxygen; echo "HAVE_DOT=$(HAVEDOT)"; \
598 echo "PROJECT_NUMBER=$(ASTERISKVERSION)") | doxygen -
601 @if [ "${OSARCH}" = "linux-gnu" ]; then \
602 if [ -f /etc/redhat-release -o -f /etc/fedora-release ]; then \
603 $(INSTALL) -m 755 contrib/init.d/rc.redhat.asterisk /etc/rc.d/init.d/asterisk; \
604 /sbin/chkconfig --add asterisk; \
605 elif [ -f /etc/debian_version ]; then \
606 $(INSTALL) -m 755 contrib/init.d/rc.debian.asterisk /etc/init.d/asterisk; \
607 /usr/sbin/update-rc.d asterisk start 10 2 3 4 5 . stop 91 2 3 4 5 .; \
608 elif [ -f /etc/gentoo-release ]; then \
609 $(INSTALL) -m 755 contrib/init.d/rc.gentoo.asterisk /etc/init.d/asterisk; \
610 /sbin/rc-update add asterisk default; \
611 elif [ -f /etc/mandrake-release ]; then \
612 $(INSTALL) -m 755 contrib/init.d/rc.mandrake.asterisk /etc/rc.d/init.d/asterisk; \
613 /sbin/chkconfig --add asterisk; \
614 elif [ -f /etc/SuSE-release -o -f /etc/novell-release ]; then \
615 $(INSTALL) -m 755 contrib/init.d/rc.suse.asterisk /etc/init.d/asterisk; \
616 /sbin/chkconfig --add asterisk; \
617 elif [ -f /etc/slackware-version ]; then \
618 echo "Slackware is not currently supported, although an init script does exist for it." \
620 echo "We could not install init scripts for your distribution."; \
623 echo "We could not install init scripts for your operating system."; \
627 $(MAKE) -C sounds all
629 # If the cleancount has been changed, force a make clean.
630 # .cleancount is the global clean count, and .lastclean is the
631 # last clean count we had
634 @if ! cmp -s .cleancount .lastclean ; then \
638 $(SUBDIRS_UNINSTALL):
639 @$(MAKE) --no-print-directory -C $(@:-uninstall=) uninstall
641 _uninstall: $(SUBDIRS_UNINSTALL)
642 rm -f $(DESTDIR)$(MODULES_DIR)/*
643 rm -f $(DESTDIR)$(ASTSBINDIR)/*asterisk*
644 rm -f $(DESTDIR)$(ASTSBINDIR)/astgenkey
645 rm -f $(DESTDIR)$(ASTSBINDIR)/autosupport
646 rm -rf $(DESTDIR)$(ASTHEADERDIR)
647 rm -rf $(DESTDIR)$(ASTDATADIR)/firmware
648 rm -rf $(DESTDIR)$(ASTMANDIR)/man8
649 $(MAKE) -C sounds uninstall
651 uninstall: _uninstall
652 @echo " +--------- Asterisk Uninstall Complete -----+"
653 @echo " + Asterisk binaries, sounds, man pages, +"
654 @echo " + headers, modules, and firmware builds, +"
655 @echo " + have all been uninstalled. +"
657 @echo " + To remove ALL traces of Asterisk, +"
658 @echo " + including configuration, spool +"
659 @echo " + directories, and logs, run the following +"
660 @echo " + command: +"
662 @echo " + $(MAKE) uninstall-all +"
663 @echo " +-------------------------------------------+"
665 uninstall-all: _uninstall
666 rm -rf $(DESTDIR)$(ASTLIBDIR)
667 rm -rf $(DESTDIR)$(ASTVARLIBDIR)
668 rm -rf $(DESTDIR)$(ASTDATADIR)
669 rm -rf $(DESTDIR)$(ASTSPOOLDIR)
670 rm -rf $(DESTDIR)$(ASTETCDIR)
671 rm -rf $(DESTDIR)$(ASTLOGDIR)
673 menuconfig: menuselect
675 menuselect: menuselect/menuselect menuselect-tree
676 -@menuselect/menuselect $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) menuselect.makeopts && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
678 menuselect/menuselect: makeopts menuselect/menuselect.c menuselect/menuselect_curses.c menuselect/menuselect_stub.c menuselect/menuselect.h menuselect/linkedlists.h makeopts
679 @CC="$(HOST_CC)" LD="" AR="" RANLIB="" $(MAKE) -C menuselect CONFIGURE_SILENT="--silent"
681 menuselect-tree: $(foreach dir,$(filter-out main,$(MOD_SUBDIRS)),$(wildcard $(dir)/*.c) $(wildcard $(dir)/*.cc)) build_tools/cflags.xml sounds/sounds.xml build_tools/embed_modules.xml
682 @echo "Generating input for menuselect ..."
683 @build_tools/prep_moduledeps > $@
685 .PHONY: menuselect main sounds clean dist-clean distclean all prereqs cleantest uninstall _uninstall uninstall-all dont-optimize $(SUBDIRS_INSTALL) $(SUBDIRS_CLEAN) $(SUBDIRS_UNINSTALL) $(SUBDIRS) $(MOD_SUBDIRS_EMBED_LDSCRIPT) $(MOD_SUBDIRS_EMBED_LDFLAGS) $(MOD_SUBDIRS_EMBED_LIBS)