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
80 ASTTOPDIR
:=$(shell pwd
)
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
/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 \
346 @
$(MAKE
) --no-print-directory
-C
$(@
:-clean=) clean
348 clean: $(SUBDIRS_CLEAN
)
350 rm -f
include/asterisk
/build.h
351 rm -f
include/asterisk
/version.h
352 @
$(MAKE
) -C menuselect
clean
353 cp
-f .cleancount .lastclean
355 dist-clean
: distclean
358 @
$(MAKE
) -C menuselect dist-clean
359 @
$(MAKE
) -C sounds dist-clean
360 rm -f menuselect.makeopts makeopts menuselect-tree menuselect.makedeps
361 rm -f makeopts.embed_rules
362 rm -f config.log config.status
363 rm -rf autom4te.cache
364 rm -f
include/asterisk
/autoconfig.h
365 rm -f
include/asterisk
/buildopts.h
367 rm -f build_tools
/menuselect-deps
370 if
[ x
`$(ID) -un` = xroot
]; then CFLAGS
="$(ASTCFLAGS)" sh build_tools
/mkpkgconfig
$(DESTDIR
)/usr
/lib
/pkgconfig
; fi
371 # Should static HTTP be installed during make samples or even with its own target ala
372 # webvoicemail? There are portions here that *could* be customized but might also be
373 # improved a lot. I'll put it here for now.
374 mkdir
-p
$(DESTDIR
)$(ASTDATADIR
)/static-http
375 for x in static-http
/*; do \
376 $(INSTALL
) -m
644 $$x $(DESTDIR
)$(ASTDATADIR
)/static-http
; \
378 mkdir
-p
$(DESTDIR
)$(ASTDATADIR
)/images
379 for x in images
/*.jpg
; do \
380 $(INSTALL
) -m
644 $$x $(DESTDIR
)$(ASTDATADIR
)/images
; \
382 mkdir
-p
$(DESTDIR
)$(AGI_DIR
)
383 $(MAKE
) -C sounds
install
386 @if
[ -d .svn
]; then \
387 echo
"Updating from Subversion..." ; \
388 svn update | tee update.out
; \
390 if
[ `grep -c ^C update.out` -gt
0 ]; then \
391 echo
; echo
"The following files have conflicts:" ; \
392 grep ^C update.out | cut
-b4-
; \
396 echo
"Not under version control"; \
399 NEWHEADERS
=$(notdir $(wildcard include/asterisk
/*.h
))
400 OLDHEADERS
=$(filter-out $(NEWHEADERS
),$(notdir $(wildcard $(DESTDIR
)$(ASTHEADERDIR
)/*.h
)))
403 mkdir
-p
$(DESTDIR
)$(MODULES_DIR
)
404 mkdir
-p
$(DESTDIR
)$(ASTSBINDIR
)
405 mkdir
-p
$(DESTDIR
)$(ASTETCDIR
)
406 mkdir
-p
$(DESTDIR
)$(ASTBINDIR
)
407 mkdir
-p
$(DESTDIR
)$(ASTVARRUNDIR
)
408 mkdir
-p
$(DESTDIR
)$(ASTSPOOLDIR
)/voicemail
409 mkdir
-p
$(DESTDIR
)$(ASTSPOOLDIR
)/dictate
410 mkdir
-p
$(DESTDIR
)$(ASTSPOOLDIR
)/system
411 mkdir
-p
$(DESTDIR
)$(ASTSPOOLDIR
)/tmp
412 mkdir
-p
$(DESTDIR
)$(ASTSPOOLDIR
)/meetme
413 mkdir
-p
$(DESTDIR
)$(ASTSPOOLDIR
)/monitor
414 $(INSTALL
) -m
755 main
/asterisk
$(DESTDIR
)$(ASTSBINDIR
)/
415 $(LN
) -sf asterisk
$(DESTDIR
)$(ASTSBINDIR
)/rasterisk
416 $(INSTALL
) -m
755 contrib
/scripts
/astgenkey
$(DESTDIR
)$(ASTSBINDIR
)/
417 $(INSTALL
) -m
755 contrib
/scripts
/autosupport
$(DESTDIR
)$(ASTSBINDIR
)/
418 if
[ ! -f
$(DESTDIR
)$(ASTSBINDIR
)/safe_asterisk
]; then \
419 cat contrib
/scripts
/safe_asterisk | sed
's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;' > $(DESTDIR
)$(ASTSBINDIR
)/safe_asterisk
;\
420 chmod
755 $(DESTDIR
)$(ASTSBINDIR
)/safe_asterisk
;\
422 $(INSTALL
) -d
$(DESTDIR
)$(ASTHEADERDIR
)
423 $(INSTALL
) -m
644 include/asterisk.h
$(DESTDIR
)$(includedir)
424 $(INSTALL
) -m
644 include/asterisk
/*.h
$(DESTDIR
)$(ASTHEADERDIR
)
425 if
[ -n
"$(OLDHEADERS)" ]; then \
426 rm -f
$(addprefix $(DESTDIR
)$(ASTHEADERDIR
)/,$(OLDHEADERS
)) ;\
428 mkdir
-p
$(DESTDIR
)$(ASTLOGDIR
)/cdr-csv
429 mkdir
-p
$(DESTDIR
)$(ASTLOGDIR
)/cdr-custom
430 mkdir
-p
$(DESTDIR
)$(ASTDATADIR
)/keys
431 mkdir
-p
$(DESTDIR
)$(ASTDATADIR
)/firmware
432 mkdir
-p
$(DESTDIR
)$(ASTDATADIR
)/firmware
/iax
433 mkdir
-p
$(DESTDIR
)$(ASTMANDIR
)/man8
434 $(INSTALL
) -m
644 keys
/iaxtel.pub
$(DESTDIR
)$(ASTDATADIR
)/keys
435 $(INSTALL
) -m
644 keys
/freeworlddialup.pub
$(DESTDIR
)$(ASTDATADIR
)/keys
436 $(INSTALL
) -m
644 doc
/asterisk
.8 $(DESTDIR
)$(ASTMANDIR
)/man8
437 $(INSTALL
) -m
644 contrib
/scripts
/astgenkey
.8 $(DESTDIR
)$(ASTMANDIR
)/man8
438 $(INSTALL
) -m
644 contrib
/scripts
/autosupport
.8 $(DESTDIR
)$(ASTMANDIR
)/man8
439 $(INSTALL
) -m
644 contrib
/scripts
/safe_asterisk
.8 $(DESTDIR
)$(ASTMANDIR
)/man8
440 if
[ -f contrib
/firmware
/iax
/iaxy.bin
] ; then \
441 $(INSTALL
) -m
644 contrib
/firmware
/iax
/iaxy.bin
$(DESTDIR
)$(ASTDATADIR
)/firmware
/iax
/iaxy.bin
; \
445 @DESTDIR
="$(DESTDIR)" ASTSBINDIR
="$(ASTSBINDIR)" $(MAKE
) -C
$(@
:-install=) install
447 NEWMODS
=$(notdir $(wildcard */*.so
))
448 OLDMODS
=$(filter-out $(NEWMODS
),$(notdir $(wildcard $(DESTDIR
)$(MODULES_DIR
)/*.so
)))
451 @if
[ -n
"$(OLDMODS)" ]; then \
452 echo
" WARNING WARNING WARNING" ;\
454 echo
" Your Asterisk modules directory, located at" ;\
455 echo
" $(DESTDIR)$(MODULES_DIR)" ;\
456 echo
" contains modules that were not installed by this " ;\
457 echo
" version of Asterisk. Please ensure that these" ;\
458 echo
" modules are compatible with this version before" ;\
459 echo
" attempting to run Asterisk." ;\
461 for f in
$(OLDMODS
); do \
465 echo
" WARNING WARNING WARNING" ;\
468 install: datafiles bininstall
$(SUBDIRS_INSTALL
)
469 @if
[ -x
/usr
/sbin
/asterisk-post-install
]; then \
470 /usr
/sbin
/asterisk-post-install
$(DESTDIR
) .
; \
472 @echo
" +---- Asterisk Installation Complete -------+"
474 @echo
" + YOU MUST READ THE SECURITY DOCUMENT +"
476 @echo
" + Asterisk has successfully been installed. +"
477 @echo
" + If you would like to install the sample +"
478 @echo
" + configuration files (overwriting any +"
479 @echo
" + existing config files), run: +"
481 @echo
" + $(MAKE) samples +"
483 @echo
" +----------------- or ---------------------+"
485 @echo
" + You can go ahead and install the asterisk +"
486 @echo
" + program documentation now or later run: +"
488 @echo
" + $(MAKE) progdocs +"
490 @echo
" + **Note** This requires that you have +"
491 @echo
" + doxygen installed on your local system +"
492 @echo
" +-------------------------------------------+"
493 @
$(MAKE
) -s oldmodcheck
498 mkdir
-p
$(DESTDIR
)$(ASTETCDIR
)
499 for x in configs
/*.adsi
; do \
500 if
[ ! -f
$(DESTDIR
)$(ASTETCDIR
)/$$x ]; then \
501 $(INSTALL
) -m
644 $$x $(DESTDIR
)$(ASTETCDIR
)/`$(BASENAME) $$x` ; \
506 mkdir
-p
$(DESTDIR
)$(ASTETCDIR
)
507 for x in configs
/*.sample
; do \
508 if
[ -f
$(DESTDIR
)$(ASTETCDIR
)/`$(BASENAME) $$x .sample` ]; then \
509 if
[ "$(OVERWRITE)" = "y" ]; then \
510 if cmp
-s
$(DESTDIR
)$(ASTETCDIR
)/`$(BASENAME) $$x .sample` $$x ; then \
511 echo
"Config file $$x is unchanged"; \
514 mv
-f
$(DESTDIR
)$(ASTETCDIR
)/`$(BASENAME) $$x .sample` $(DESTDIR
)$(ASTETCDIR
)/`$(BASENAME) $$x .sample`.old
; \
516 echo
"Skipping config file $$x"; \
520 $(INSTALL
) -m
644 $$x $(DESTDIR
)$(ASTETCDIR
)/`$(BASENAME) $$x .sample` ;\
522 if
[ "$(OVERWRITE)" = "y" ] ||
[ ! -f
$(DESTDIR
)$(ASTCONFPATH
) ]; then \
524 echo
"[directories]" ; \
525 echo
"astetcdir => $(ASTETCDIR)" ; \
526 echo
"astmoddir => $(MODULES_DIR)" ; \
527 echo
"astvarlibdir => $(ASTVARLIBDIR)" ; \
528 echo
"astdatadir => $(ASTDATADIR)" ; \
529 echo
"astagidir => $(AGI_DIR)" ; \
530 echo
"astspooldir => $(ASTSPOOLDIR)" ; \
531 echo
"astrundir => $(ASTVARRUNDIR)" ; \
532 echo
"astlogdir => $(ASTLOGDIR)" ; \
534 echo
";[options]" ; \
535 echo
";internal_timing = yes" ; \
536 echo
";systemname = my_system_name ; prefix uniqueid with a system name for global uniqueness issues" ; \
537 echo
"; Changing the following lines may compromise your security." ; \
539 echo
";astctlpermissions = 0660" ; \
540 echo
";astctlowner = root" ; \
541 echo
";astctlgroup = apache" ; \
542 echo
";astctl = asterisk.ctl" ; \
543 ) > $(DESTDIR
)$(ASTCONFPATH
) ; \
545 echo
"Skipping asterisk.conf creation"; \
547 mkdir
-p
$(DESTDIR
)$(ASTSPOOLDIR
)/voicemail
/default
/1234/INBOX
548 build_tools
/make_sample_voicemail
$(DESTDIR
)/$(ASTDATADIR
) $(DESTDIR
)/$(ASTSPOOLDIR
)
551 @
[ -d
$(DESTDIR
)$(HTTP_DOCSDIR
)/ ] ||
( printf
"http docs directory not found.\nUpdate assignment of variable HTTP_DOCSDIR in Makefile!\n" && exit
1 )
552 @
[ -d
$(DESTDIR
)$(HTTP_CGIDIR
) ] ||
( printf
"cgi-bin directory not found.\nUpdate assignment of variable HTTP_CGIDIR in Makefile!\n" && exit
1 )
553 $(INSTALL
) -m
4755 -o root
-g root contrib
/scripts
/vmail.cgi
$(DESTDIR
)$(HTTP_CGIDIR
)/vmail.cgi
554 mkdir
-p
$(DESTDIR
)$(HTTP_DOCSDIR
)/_asterisk
555 for x in images
/*.gif
; do \
556 $(INSTALL
) -m
644 $$x $(DESTDIR
)$(HTTP_DOCSDIR
)/_asterisk
/; \
558 @echo
" +--------- Asterisk Web Voicemail ----------+"
560 @echo
" + Asterisk Web Voicemail is installed in +"
561 @echo
" + your cgi-bin directory: +"
562 @echo
" + $(DESTDIR)$(HTTP_CGIDIR)"
563 @echo
" + IT USES A SETUID ROOT PERL SCRIPT, SO +"
564 @echo
" + IF YOU DON'T LIKE THAT, UNINSTALL IT! +"
566 @echo
" + Other static items have been stored in: +"
567 @echo
" + $(DESTDIR)$(HTTP_DOCSDIR)"
569 @echo
" + If these paths do not match your httpd +"
570 @echo
" + installation, correct the definitions +"
571 @echo
" + in your Makefile of HTTP_CGIDIR and +"
572 @echo
" + HTTP_DOCSDIR +"
574 @echo
" +-------------------------------------------+"
577 sed
"s/^Version:.*/Version: $(RPMVERSION)/g" redhat
/asterisk.spec
> asterisk.spec
; \
581 __rpm
: include/asterisk
/version.h
include/asterisk
/buildopts.h spec
582 rm -rf
/tmp
/asterisk
; \
583 mkdir
-p
/tmp
/asterisk
/redhat
/RPMS
/i386
; \
584 $(MAKE
) DESTDIR
=/tmp
/asterisk
install ; \
585 $(MAKE
) DESTDIR
=/tmp
/asterisk samples
; \
586 mkdir
-p
/tmp
/asterisk
/etc
/rc.d
/init.d
; \
587 cp
-f contrib
/init.d
/rc.redhat.asterisk
/tmp
/asterisk
/etc
/rc.d
/init.d
/asterisk
; \
588 rpmbuild
--rcfile
/usr
/lib
/rpm
/rpmrc
:redhat
/rpmrc
-bb asterisk.spec
591 (cat contrib
/asterisk-ng-doxygen
; echo
"HAVE_DOT=$(HAVEDOT)"; \
592 echo
"PROJECT_NUMBER=$(ASTERISKVERSION)") | doxygen
-
595 @if
[ "${OSARCH}" = "linux-gnu" ]; then \
596 if
[ -f
/etc
/redhat-release
-o
-f
/etc
/fedora-release
]; then \
597 $(INSTALL
) -m
755 contrib
/init.d
/rc.redhat.asterisk
/etc
/rc.d
/init.d
/asterisk
; \
598 /sbin
/chkconfig
--add asterisk
; \
599 elif
[ -f
/etc
/debian_version
]; then \
600 $(INSTALL
) -m
755 contrib
/init.d
/rc.debian.asterisk
/etc
/init.d
/asterisk
; \
601 /usr
/sbin
/update-rc.d asterisk start
10 2 3 4 5 . stop
91 2 3 4 5 .
; \
602 elif
[ -f
/etc
/gentoo-release
]; then \
603 $(INSTALL
) -m
755 contrib
/init.d
/rc.gentoo.asterisk
/etc
/init.d
/asterisk
; \
604 /sbin
/rc-update add asterisk default
; \
605 elif
[ -f
/etc
/mandrake-release
]; then \
606 $(INSTALL
) -m
755 contrib
/init.d
/rc.mandrake.asterisk
/etc
/rc.d
/init.d
/asterisk
; \
607 /sbin
/chkconfig
--add asterisk
; \
608 elif
[ -f
/etc
/SuSE-release
-o
-f
/etc
/novell-release
]; then \
609 $(INSTALL
) -m
755 contrib
/init.d
/rc.suse.asterisk
/etc
/init.d
/asterisk
; \
610 /sbin
/chkconfig
--add asterisk
; \
611 elif
[ -f
/etc
/slackware-version
]; then \
612 echo
"Slackware is not currently supported, although an init script does exist for it." \
614 echo
"We could not install init scripts for your distribution."; \
617 echo
"We could not install init scripts for your operating system."; \
621 $(MAKE
) -C sounds
all
623 # If the cleancount has been changed, force a make clean.
624 # .cleancount is the global clean count, and .lastclean is the
625 # last clean count we had
628 @if
! cmp
-s .cleancount .lastclean
; then \
632 $(SUBDIRS_UNINSTALL
):
633 @
$(MAKE
) --no-print-directory
-C
$(@
:-uninstall=) uninstall
635 _uninstall
: $(SUBDIRS_UNINSTALL
)
636 rm -f
$(DESTDIR
)$(MODULES_DIR
)/*
637 rm -f
$(DESTDIR
)$(ASTSBINDIR
)/*asterisk
*
638 rm -f
$(DESTDIR
)$(ASTSBINDIR
)/astgenkey
639 rm -f
$(DESTDIR
)$(ASTSBINDIR
)/autosupport
640 rm -rf
$(DESTDIR
)$(ASTHEADERDIR
)
641 rm -rf
$(DESTDIR
)$(ASTDATADIR
)/firmware
642 rm -rf
$(DESTDIR
)$(ASTMANDIR
)/man8
643 $(MAKE
) -C sounds
uninstall
645 uninstall: _uninstall
646 @echo
" +--------- Asterisk Uninstall Complete -----+"
647 @echo
" + Asterisk binaries, sounds, man pages, +"
648 @echo
" + headers, modules, and firmware builds, +"
649 @echo
" + have all been uninstalled. +"
651 @echo
" + To remove ALL traces of Asterisk, +"
652 @echo
" + including configuration, spool +"
653 @echo
" + directories, and logs, run the following +"
654 @echo
" + command: +"
656 @echo
" + $(MAKE) uninstall-all +"
657 @echo
" +-------------------------------------------+"
659 uninstall-all
: _uninstall
660 rm -rf
$(DESTDIR
)$(ASTLIBDIR
)
661 rm -rf
$(DESTDIR
)$(ASTVARLIBDIR
)
662 rm -rf
$(DESTDIR
)$(ASTDATADIR
)
663 rm -rf
$(DESTDIR
)$(ASTSPOOLDIR
)
664 rm -rf
$(DESTDIR
)$(ASTETCDIR
)
665 rm -rf
$(DESTDIR
)$(ASTLOGDIR
)
667 menuconfig
: menuselect
669 gmenuconfig
: gmenuselect
671 menuselect
: menuselect
/menuselect menuselect-tree
672 -@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!"
674 gmenuselect
: menuselect
/gmenuselect menuselect-tree
675 -@menuselect
/gmenuselect
$(GLOBAL_MAKEOPTS
) $(USER_MAKEOPTS
) menuselect.makeopts
&& (echo
"menuselect changes saved!"; rm -f channels
/h323
/Makefile.ast main
/asterisk
) || echo
"menuselect changes NOT saved!"
677 menuselect
/menuselect
: makeopts menuselect
/menuselect.c menuselect
/menuselect_curses.c menuselect
/menuselect_stub.c menuselect
/menuselect.h menuselect
/linkedlists.h makeopts
678 @CC
="$(HOST_CC)" LD
="" AR
="" RANLIB
="" $(MAKE
) -C menuselect CONFIGURE_SILENT
="--silent"
680 menuselect
/gmenuselect
: makeopts menuselect
/menuselect.c menuselect
/menuselect_gtk.c menuselect
/menuselect_stub.c menuselect
/menuselect.h menuselect
/linkedlists.h makeopts
681 @CC
="$(HOST_CC)" CXX
="$(CXX)" LD
="" AR
="" RANLIB
="" $(MAKE
) -C menuselect _gmenuselect CONFIGURE_SILENT
="--silent"
683 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
684 @echo
"Generating input for menuselect ..."
685 @build_tools
/prep_moduledeps
> $@
687 .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
)