Review Board 1.7.16


Bridging API for Conference Bridge purposes

Review Request #93 - Created Dec. 15, 2008 and submitted

Joshua Colp
team/file/bridging
Reviewers
asterisk-dev
russell
Asterisk
This patch implements the new bridging API and brings with it a module for conference bridges. It does *not* replace existing internal bridging or features yet and will not cause any regressions when put in. It will essentially be introduced as a first test phase to work out any unforeseen critical issues. The bridging core itself is fully implemented besides the following: jitterbuffer support, native bridging, and interval hooks (hooks that are time based versus action based). If you would like an explanation of what the bridging API is made up of and how it works that can be found in the bridging.h header file.
Conference bridge testing using app_confbridge with features. Joining two channels with simple frame exchange and joining three channels to move it to a true conference bridge. IVR capability of app_confbridge was also tested.
/trunk/Makefile
Revision 179359 New Change
1
#
1
#
2
# Asterisk -- A telephony toolkit for Linux.
2
# Asterisk -- A telephony toolkit for Linux.
3
# 
3
# 
4
# Top level Makefile
4
# Top level Makefile
5
#
5
#
6
# Copyright (C) 1999-2006, Digium, Inc.
6
# Copyright (C) 1999-2006, Digium, Inc.
7
#
7
#
8
# Mark Spencer <markster@digium.com>
8
# Mark Spencer <markster@digium.com>
9
#
9
#
10
# This program is free software, distributed under the terms of
10
# This program is free software, distributed under the terms of
11
# the GNU General Public License
11
# the GNU General Public License
12
#
12
#
13

    
   
13

   
14
# All Makefiles use the following variables:
14
# All Makefiles use the following variables:
15
#
15
#
16
# ASTCFLAGS - compiler options
16
# ASTCFLAGS - compiler options
17
# ASTLDFLAGS - linker flags (not libraries)
17
# ASTLDFLAGS - linker flags (not libraries)
18
# LIBS - additional libraries, at top-level for all links,
18
# LIBS - additional libraries, at top-level for all links,
19
#      on a single object just for that object
19
#      on a single object just for that object
20
# SOLINK - linker flags used only for creating shared objects (.so files),
20
# SOLINK - linker flags used only for creating shared objects (.so files),
21
#      used for all .so links
21
#      used for all .so links
22
#
22
#
23
# Initial values for ASTCFLAGS and ASTLDFLAGS can be specified in the
23
# Initial values for ASTCFLAGS and ASTLDFLAGS can be specified in the
24
# environment when running make, as follows:
24
# environment when running make, as follows:
25
#
25
#
26
#	$ ASTCFLAGS="-Werror" make ...
26
#	$ ASTCFLAGS="-Werror" make ...
27
#
27
#
28
# note that this is different from
28
# note that this is different from
29
#
29
#
30
#	$ make ASTCFLAGS="-Werror" ...
30
#	$ make ASTCFLAGS="-Werror" ...
31
#
31
#
32
# If you need to pass compiler/linker flags as 'make' variables, please use
32
# If you need to pass compiler/linker flags as 'make' variables, please use
33
#
33
#
34
#	$ make COPTS="..." LDOPTS="..." ...
34
#	$ make COPTS="..." LDOPTS="..." ...
35
#
35
#
36
#
36
#
37
# You can add the path of local module subdirs from the command line with
37
# You can add the path of local module subdirs from the command line with
38
#   make LOCAL_MOD_SUBDIRS= ....
38
#   make LOCAL_MOD_SUBDIRS= ....
39

    
   
39

   
40
export ASTTOPDIR		# Top level dir, used in subdirs' Makefiles
40
export ASTTOPDIR		# Top level dir, used in subdirs' Makefiles
41
export ASTERISKVERSION
41
export ASTERISKVERSION
42
export ASTERISKVERSIONNUM
42
export ASTERISKVERSIONNUM
43

    
   
43

   
44
#--- values used for default paths
44
#--- values used for default paths
45

    
   
45

   
46
# DESTDIR is the staging (or final) directory where files are copied
46
# DESTDIR is the staging (or final) directory where files are copied
47
# during the install process. Define it before 'export', otherwise
47
# during the install process. Define it before 'export', otherwise
48
# export will set it to the empty string making ?= fail.
48
# export will set it to the empty string making ?= fail.
49
# WARNING: do not put spaces or comments after the value.
49
# WARNING: do not put spaces or comments after the value.
50
DESTDIR?=$(INSTALL_PATH)
50
DESTDIR?=$(INSTALL_PATH)
51
export DESTDIR
51
export DESTDIR
52

    
   
52

   
53
export INSTALL_PATH	# Additional prefix for the following paths
53
export INSTALL_PATH	# Additional prefix for the following paths
54
export ASTETCDIR		# Path for config files
54
export ASTETCDIR		# Path for config files
55
export ASTVARRUNDIR
55
export ASTVARRUNDIR
56
export MODULES_DIR
56
export MODULES_DIR
57
export ASTSPOOLDIR
57
export ASTSPOOLDIR
58
export ASTVARLIBDIR
58
export ASTVARLIBDIR
59
export ASTDATADIR
59
export ASTDATADIR
60
export ASTDBDIR
60
export ASTDBDIR
61
export ASTLOGDIR
61
export ASTLOGDIR
62
export ASTLIBDIR
62
export ASTLIBDIR
63
export ASTMANDIR
63
export ASTMANDIR
64
export ASTHEADERDIR
64
export ASTHEADERDIR
65
export ASTBINDIR
65
export ASTBINDIR
66
export ASTSBINDIR
66
export ASTSBINDIR
67
export AGI_DIR
67
export AGI_DIR
68
export ASTCONFPATH
68
export ASTCONFPATH
69

    
   
69

   
70
export OSARCH			# Operating system
70
export OSARCH			# Operating system
71
export PROC			# Processor type
71
export PROC			# Processor type
72

    
   
72

   
73
export NOISY_BUILD		# Used in Makefile.rules
73
export NOISY_BUILD		# Used in Makefile.rules
74
export MENUSELECT_CFLAGS	# Options selected in menuselect.
74
export MENUSELECT_CFLAGS	# Options selected in menuselect.
75
export AST_DEVMODE		# Set to "yes" for additional compiler
75
export AST_DEVMODE		# Set to "yes" for additional compiler
76
                                # and runtime checks
76
                                # and runtime checks
77

    
   
77

   
78
export SOLINK			# linker flags for shared objects
78
export SOLINK			# linker flags for shared objects
79
export STATIC_BUILD		# Additional cflags, set to -static
79
export STATIC_BUILD		# Additional cflags, set to -static
80
                                # for static builds. Probably
80
                                # for static builds. Probably
81
                                # should go directly to ASTLDFLAGS
81
                                # should go directly to ASTLDFLAGS
82

    
   
82

   
83
#--- paths to various commands
83
#--- paths to various commands
84
export CC
84
export CC
85
export CXX
85
export CXX
86
export AR
86
export AR
87
export RANLIB
87
export RANLIB
88
export HOST_CC
88
export HOST_CC
89
export INSTALL
89
export INSTALL
90
export STRIP
90
export STRIP
91
export DOWNLOAD
91
export DOWNLOAD
92
export AWK
92
export AWK
93
export GREP
93
export GREP
94
export ID
94
export ID
95
export MD5
95
export MD5
96

    
   
96

   
97
# even though we could use '-include makeopts' here, use a wildcard
97
# even though we could use '-include makeopts' here, use a wildcard
98
# lookup anyway, so that make won't try to build makeopts if it doesn't
98
# lookup anyway, so that make won't try to build makeopts if it doesn't
99
# exist (other rules will force it to be built if needed)
99
# exist (other rules will force it to be built if needed)
100
ifneq ($(wildcard makeopts),)
100
ifneq ($(wildcard makeopts),)
101
  include makeopts
101
  include makeopts
102
endif
102
endif
103

    
   
103

   
104
# Some build systems, such as the one in openwrt, like to pass custom target
104
# Some build systems, such as the one in openwrt, like to pass custom target
105
# CFLAGS and LDFLAGS in the COPTS and LDOPTS variables.
105
# CFLAGS and LDFLAGS in the COPTS and LDOPTS variables.
106
ASTCFLAGS+=$(COPTS)
106
ASTCFLAGS+=$(COPTS)
107
ASTLDFLAGS+=$(LDOPTS)
107
ASTLDFLAGS+=$(LDOPTS)
108

    
   
108

   
109
# libxml2 cflags
109
# libxml2 cflags
110
ASTCFLAGS+=$(LIBXML2_INCLUDE)
110
ASTCFLAGS+=$(LIBXML2_INCLUDE)
111

    
   
111

   
112
#Uncomment this to see all build commands instead of 'quiet' output
112
#Uncomment this to see all build commands instead of 'quiet' output
113
#NOISY_BUILD=yes
113
#NOISY_BUILD=yes
114

    
   
114

   
115
empty:=
115
empty:=
116
space:=$(empty) $(empty)
116
space:=$(empty) $(empty)
117
ASTTOPDIR:=$(subst $(space),\$(space),$(CURDIR))
117
ASTTOPDIR:=$(subst $(space),\$(space),$(CURDIR))
118

    
   
118

   
119
# Overwite config files on "make samples"
119
# Overwite config files on "make samples"
120
OVERWRITE=y
120
OVERWRITE=y
121

    
   
121

   
122
# Include debug and macro symbols in the executables (-g) and profiling info (-pg)
122
# Include debug and macro symbols in the executables (-g) and profiling info (-pg)
123
DEBUG=-g3
123
DEBUG=-g3
124

    
   
124

   
125

    
   
125

   
126
# Define standard directories for various platforms
126
# Define standard directories for various platforms
127
# These apply if they are not redefined in asterisk.conf 
127
# These apply if they are not redefined in asterisk.conf 
128
ifeq ($(OSARCH),SunOS)
128
ifeq ($(OSARCH),SunOS)
129
  ASTETCDIR=/var/etc/asterisk
129
  ASTETCDIR=/var/etc/asterisk
130
  ASTLIBDIR=/opt/asterisk/lib
130
  ASTLIBDIR=/opt/asterisk/lib
131
  ASTVARLIBDIR=/var/opt/asterisk
131
  ASTVARLIBDIR=/var/opt/asterisk
132
  ASTDBDIR=$(ASTVARLIBDIR)
132
  ASTDBDIR=$(ASTVARLIBDIR)
133
  ASTKEYDIR=$(ASTVARLIBDIR)
133
  ASTKEYDIR=$(ASTVARLIBDIR)
134
  ASTSPOOLDIR=/var/spool/asterisk
134
  ASTSPOOLDIR=/var/spool/asterisk
135
  ASTLOGDIR=/var/log/asterisk
135
  ASTLOGDIR=/var/log/asterisk
136
  ASTHEADERDIR=/opt/asterisk/include
136
  ASTHEADERDIR=/opt/asterisk/include
137
  ASTBINDIR=/opt/asterisk/bin
137
  ASTBINDIR=/opt/asterisk/bin
138
  ASTSBINDIR=/opt/asterisk/sbin
138
  ASTSBINDIR=/opt/asterisk/sbin
139
  ASTVARRUNDIR=/var/run/asterisk
139
  ASTVARRUNDIR=/var/run/asterisk
140
  ASTMANDIR=/opt/asterisk/man
140
  ASTMANDIR=/opt/asterisk/man
141
else
141
else
142
  ASTETCDIR=$(sysconfdir)/asterisk
142
  ASTETCDIR=$(sysconfdir)/asterisk
143
  ASTLIBDIR=$(libdir)/asterisk
143
  ASTLIBDIR=$(libdir)/asterisk
144
  ASTHEADERDIR=$(includedir)/asterisk
144
  ASTHEADERDIR=$(includedir)/asterisk
145
  ASTBINDIR=$(bindir)
145
  ASTBINDIR=$(bindir)
146
  ASTSBINDIR=$(sbindir)
146
  ASTSBINDIR=$(sbindir)
147
  ASTSPOOLDIR=$(localstatedir)/spool/asterisk
147
  ASTSPOOLDIR=$(localstatedir)/spool/asterisk
148
  ASTLOGDIR=$(localstatedir)/log/asterisk
148
  ASTLOGDIR=$(localstatedir)/log/asterisk
149
  ASTVARRUNDIR=$(localstatedir)/run/asterisk
149
  ASTVARRUNDIR=$(localstatedir)/run/asterisk
150
  ASTMANDIR=$(mandir)
150
  ASTMANDIR=$(mandir)
151
ifneq ($(findstring BSD,$(OSARCH)),)
151
ifneq ($(findstring BSD,$(OSARCH)),)
152
  ASTVARLIBDIR=$(prefix)/share/asterisk
152
  ASTVARLIBDIR=$(prefix)/share/asterisk
153
  ASTVARRUNDIR=$(localstatedir)/run/asterisk
153
  ASTVARRUNDIR=$(localstatedir)/run/asterisk
154
  ASTDBDIR=$(localstatedir)/db/asterisk
154
  ASTDBDIR=$(localstatedir)/db/asterisk
155
else
155
else
156
  ASTVARLIBDIR=$(localstatedir)/lib/asterisk
156
  ASTVARLIBDIR=$(localstatedir)/lib/asterisk
157
  ASTDBDIR=$(ASTVARLIBDIR)
157
  ASTDBDIR=$(ASTVARLIBDIR)
158
endif
158
endif
159
  ASTKEYDIR=$(ASTVARLIBDIR)
159
  ASTKEYDIR=$(ASTVARLIBDIR)
160
endif
160
endif
161
ifeq ($(ASTDATADIR),)
161
ifeq ($(ASTDATADIR),)
162
  ASTDATADIR:=$(ASTVARLIBDIR)
162
  ASTDATADIR:=$(ASTVARLIBDIR)
163
endif
163
endif
164

    
   
164

   
165
# Asterisk.conf is located in ASTETCDIR or by using the -C flag
165
# Asterisk.conf is located in ASTETCDIR or by using the -C flag
166
# when starting Asterisk
166
# when starting Asterisk
167
ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
167
ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
168
MODULES_DIR=$(ASTLIBDIR)/modules
168
MODULES_DIR=$(ASTLIBDIR)/modules
169
AGI_DIR=$(ASTDATADIR)/agi-bin
169
AGI_DIR=$(ASTDATADIR)/agi-bin
170

    
   
170

   
171
# If you use Apache, you may determine by a grep 'DocumentRoot' of your httpd.conf file
171
# If you use Apache, you may determine by a grep 'DocumentRoot' of your httpd.conf file
172
HTTP_DOCSDIR=/var/www/html
172
HTTP_DOCSDIR=/var/www/html
173
# Determine by a grep 'ScriptAlias' of your Apache httpd.conf file
173
# Determine by a grep 'ScriptAlias' of your Apache httpd.conf file
174
HTTP_CGIDIR=/var/www/cgi-bin
174
HTTP_CGIDIR=/var/www/cgi-bin
175

    
   
175

   
176
# Uncomment this to use the older DSP routines
176
# Uncomment this to use the older DSP routines
177
#ASTCFLAGS+=-DOLD_DSP_ROUTINES
177
#ASTCFLAGS+=-DOLD_DSP_ROUTINES
178

    
   
178

   
179
# If the file .asterisk.makeopts is present in your home directory, you can
179
# If the file .asterisk.makeopts is present in your home directory, you can
180
# include all of your favorite menuselect options so that every time you download
180
# include all of your favorite menuselect options so that every time you download
181
# a new version of Asterisk, you don't have to run menuselect to set them. 
181
# a new version of Asterisk, you don't have to run menuselect to set them. 
182
# The file /etc/asterisk.makeopts will also be included but can be overridden
182
# The file /etc/asterisk.makeopts will also be included but can be overridden
183
# by the file in your home directory.
183
# by the file in your home directory.
184

    
   
184

   
185
GLOBAL_MAKEOPTS=$(wildcard /etc/asterisk.makeopts)
185
GLOBAL_MAKEOPTS=$(wildcard /etc/asterisk.makeopts)
186
USER_MAKEOPTS=$(wildcard ~/.asterisk.makeopts)
186
USER_MAKEOPTS=$(wildcard ~/.asterisk.makeopts)
187

    
   
187

   
188
MOD_SUBDIR_CFLAGS=-I$(ASTTOPDIR)/include
188
MOD_SUBDIR_CFLAGS=-I$(ASTTOPDIR)/include
189
OTHER_SUBDIR_CFLAGS=-I$(ASTTOPDIR)/include
189
OTHER_SUBDIR_CFLAGS=-I$(ASTTOPDIR)/include
190

    
   
190

   
191
# Create OPTIONS variable, but probably we can assign directly to ASTCFLAGS
191
# Create OPTIONS variable, but probably we can assign directly to ASTCFLAGS
192
OPTIONS=
192
OPTIONS=
193

    
   
193

   
194
ifeq ($(OSARCH),linux-gnu)
194
ifeq ($(OSARCH),linux-gnu)
195
  ifeq ($(PROC),x86_64)
195
  ifeq ($(PROC),x86_64)
196
    # You must have GCC 3.4 to use k8, otherwise use athlon
196
    # You must have GCC 3.4 to use k8, otherwise use athlon
197
    PROC=k8
197
    PROC=k8
198
    #PROC=athlon
198
    #PROC=athlon
199
  endif
199
  endif
200

    
   
200

   
201
  ifeq ($(PROC),sparc64)
201
  ifeq ($(PROC),sparc64)
202
    #The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
202
    #The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
203
    #This works for even old (2.96) versions of gcc and provides a small boost either way.
203
    #This works for even old (2.96) versions of gcc and provides a small boost either way.
204
    #A ultrasparc cpu is really v9 but the stock debian stable 3.0 gcc doesn't support it.
204
    #A ultrasparc cpu is really v9 but the stock debian stable 3.0 gcc doesn't support it.
205
    #So we go lowest common available by gcc and go a step down, still a step up from
205
    #So we go lowest common available by gcc and go a step down, still a step up from
206
    #the default as we now have a better instruction set to work with. - Belgarath
206
    #the default as we now have a better instruction set to work with. - Belgarath
207
    PROC=ultrasparc
207
    PROC=ultrasparc
208
    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) -mtune=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mtune=$(PROC)"; fi)
209
    OPTIONS+=$(shell if $(CC) -mcpu=v8 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mcpu=v8"; fi)
209
    OPTIONS+=$(shell if $(CC) -mcpu=v8 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mcpu=v8"; fi)
210
    OPTIONS+=-fomit-frame-pointer
210
    OPTIONS+=-fomit-frame-pointer
211
  endif
211
  endif
212

    
   
212

   
213
  ifeq ($(PROC),arm)
213
  ifeq ($(PROC),arm)
214
    # The Cirrus logic is the only heavily shipping arm processor with a real floating point unit
214
    # The Cirrus logic is the only heavily shipping arm processor with a real floating point unit
215
    ifeq ($(SUB_PROC),maverick)
215
    ifeq ($(SUB_PROC),maverick)
216
      OPTIONS+=-fsigned-char -mcpu=ep9312
216
      OPTIONS+=-fsigned-char -mcpu=ep9312
217
    else
217
    else
218
      ifeq ($(SUB_PROC),xscale)
218
      ifeq ($(SUB_PROC),xscale)
219
        OPTIONS+=-fsigned-char -mcpu=xscale
219
        OPTIONS+=-fsigned-char -mcpu=xscale
220
      else
220
      else
221
        OPTIONS+=-fsigned-char 
221
        OPTIONS+=-fsigned-char 
222
      endif
222
      endif
223
    endif
223
    endif
224
  endif
224
  endif
225
endif
225
endif
226

    
   
226

   
227
ifeq ($(findstring -save-temps,$(ASTCFLAGS)),)
227
ifeq ($(findstring -save-temps,$(ASTCFLAGS)),)
228
  ifeq ($(findstring -pipe,$(ASTCFLAGS)),)
228
  ifeq ($(findstring -pipe,$(ASTCFLAGS)),)
229
    ASTCFLAGS+=-pipe
229
    ASTCFLAGS+=-pipe
230
  endif
230
  endif
231
endif
231
endif
232

    
   
232

   
233
ifeq ($(findstring -Wall,$(ASTCFLAGS)),)
233
ifeq ($(findstring -Wall,$(ASTCFLAGS)),)
234
  ASTCFLAGS+=-Wall
234
  ASTCFLAGS+=-Wall
235
endif
235
endif
236

    
   
236

   
237
ASTCFLAGS+=-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG)
237
ASTCFLAGS+=-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG)
238

    
   
238

   
239
ifeq ($(AST_DEVMODE),yes)
239
ifeq ($(AST_DEVMODE),yes)
240
  ASTCFLAGS+=-Werror
240
  ASTCFLAGS+=-Werror
241
  ASTCFLAGS+=-Wunused
241
  ASTCFLAGS+=-Wunused
242
  ASTCFLAGS+=$(AST_DECLARATION_AFTER_STATEMENT)
242
  ASTCFLAGS+=$(AST_DECLARATION_AFTER_STATEMENT)
243
  ASTCFLAGS+=$(AST_FORTIFY_SOURCE)
243
  ASTCFLAGS+=$(AST_FORTIFY_SOURCE)
244
  ASTCFLAGS+=-Wundef 
244
  ASTCFLAGS+=-Wundef 
245
  ASTCFLAGS+=-Wmissing-format-attribute
245
  ASTCFLAGS+=-Wmissing-format-attribute
246
  ASTCFLAGS+=-Wformat=2
246
  ASTCFLAGS+=-Wformat=2
247
endif
247
endif
248

    
   
248

   
249
ifneq ($(findstring BSD,$(OSARCH)),)
249
ifneq ($(findstring BSD,$(OSARCH)),)
250
  ASTCFLAGS+=-I/usr/local/include
250
  ASTCFLAGS+=-I/usr/local/include
251
  ASTLDFLAGS+=-L/usr/local/lib
251
  ASTLDFLAGS+=-L/usr/local/lib
252
endif
252
endif
253

    
   
253

   
254
ifeq ($(findstring -march,$(ASTCFLAGS)),)
254
ifeq ($(findstring -march,$(ASTCFLAGS)),)
255
  ifneq ($(PROC),ultrasparc)
255
  ifneq ($(PROC),ultrasparc)
256
    ASTCFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
256
    ASTCFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
257
  endif
257
  endif
258
endif
258
endif
259

    
   
259

   
260
ifeq ($(PROC),ppc)
260
ifeq ($(PROC),ppc)
261
  ASTCFLAGS+=-fsigned-char
261
  ASTCFLAGS+=-fsigned-char
262
endif
262
endif
263

    
   
263

   
264
ifeq ($(OSARCH),FreeBSD)
264
ifeq ($(OSARCH),FreeBSD)
265
  # -V is understood by BSD Make, not by GNU make.
265
  # -V is understood by BSD Make, not by GNU make.
266
  BSDVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
266
  BSDVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
267
  ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
267
  ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
268
endif
268
endif
269

    
   
269

   
270
ifeq ($(OSARCH),NetBSD)
270
ifeq ($(OSARCH),NetBSD)
271
  ASTCFLAGS+=-pthread -I/usr/pkg/include
271
  ASTCFLAGS+=-pthread -I/usr/pkg/include
272
endif
272
endif
273

    
   
273

   
274
ifeq ($(OSARCH),OpenBSD)
274
ifeq ($(OSARCH),OpenBSD)
275
  ASTCFLAGS+=-pthread -ftrampolines
275
  ASTCFLAGS+=-pthread -ftrampolines
276
endif
276
endif
277

    
   
277

   
278
ifeq ($(OSARCH),SunOS)
278
ifeq ($(OSARCH),SunOS)
279
  ASTCFLAGS+=-Wcast-align -DSOLARIS -I../include/solaris-compat -I/opt/ssl/include -I/usr/local/ssl/include -D_XPG4_2
279
  ASTCFLAGS+=-Wcast-align -DSOLARIS -I../include/solaris-compat -I/opt/ssl/include -I/usr/local/ssl/include -D_XPG4_2
280
endif
280
endif
281

    
   
281

   
282
ASTERISKVERSION:=$(shell GREP=$(GREP) AWK=$(AWK) build_tools/make_version .)
282
ASTERISKVERSION:=$(shell GREP=$(GREP) AWK=$(AWK) build_tools/make_version .)
283

    
   
283

   
284
ifneq ($(wildcard .version),)
284
ifneq ($(wildcard .version),)
285
  ASTERISKVERSIONNUM:=$(shell $(AWK) -F. '{printf "%01d%02d%02d", $$1, $$2, $$3}' .version)
285
  ASTERISKVERSIONNUM:=$(shell $(AWK) -F. '{printf "%01d%02d%02d", $$1, $$2, $$3}' .version)
286
endif
286
endif
287

    
   
287

   
288
ifneq ($(wildcard .svn),)
288
ifneq ($(wildcard .svn),)
289
  ASTERISKVERSIONNUM:=999999
289
  ASTERISKVERSIONNUM:=999999
290
endif
290
endif
291

    
   
291

   
292
# XXX MALLOC_DEBUG is probably unused, Makefile.moddir_rules adds the
292
# XXX MALLOC_DEBUG is probably unused, Makefile.moddir_rules adds the
293
#	value directly to ASTCFLAGS
293
#	value directly to ASTCFLAGS
294
ASTCFLAGS+=$(MALLOC_DEBUG)$(OPTIONS)
294
ASTCFLAGS+=$(MALLOC_DEBUG)$(OPTIONS)
295

    
   
295

   
296
MOD_SUBDIRS:=channels pbx apps codecs formats cdr funcs tests main res $(LOCAL_MOD_SUBDIRS)
296
MOD_SUBDIRS:=channels pbx apps codecs formats cdr bridges funcs tests main res $(LOCAL_MOD_SUBDIRS)
297
OTHER_SUBDIRS:=utils agi
297
OTHER_SUBDIRS:=utils agi
298
SUBDIRS:=$(OTHER_SUBDIRS) $(MOD_SUBDIRS)
298
SUBDIRS:=$(OTHER_SUBDIRS) $(MOD_SUBDIRS)
299
SUBDIRS_INSTALL:=$(SUBDIRS:%=%-install)
299
SUBDIRS_INSTALL:=$(SUBDIRS:%=%-install)
300
SUBDIRS_CLEAN:=$(SUBDIRS:%=%-clean)
300
SUBDIRS_CLEAN:=$(SUBDIRS:%=%-clean)
301
SUBDIRS_DIST_CLEAN:=$(SUBDIRS:%=%-dist-clean)
301
SUBDIRS_DIST_CLEAN:=$(SUBDIRS:%=%-dist-clean)
302
SUBDIRS_UNINSTALL:=$(SUBDIRS:%=%-uninstall)
302
SUBDIRS_UNINSTALL:=$(SUBDIRS:%=%-uninstall)
303
MOD_SUBDIRS_EMBED_LDSCRIPT:=$(MOD_SUBDIRS:%=%-embed-ldscript)
303
MOD_SUBDIRS_EMBED_LDSCRIPT:=$(MOD_SUBDIRS:%=%-embed-ldscript)
304
MOD_SUBDIRS_EMBED_LDFLAGS:=$(MOD_SUBDIRS:%=%-embed-ldflags)
304
MOD_SUBDIRS_EMBED_LDFLAGS:=$(MOD_SUBDIRS:%=%-embed-ldflags)
305
MOD_SUBDIRS_EMBED_LIBS:=$(MOD_SUBDIRS:%=%-embed-libs)
305
MOD_SUBDIRS_EMBED_LIBS:=$(MOD_SUBDIRS:%=%-embed-libs)
306
MOD_SUBDIRS_MENUSELECT_TREE:=$(MOD_SUBDIRS:%=%-menuselect-tree)
306
MOD_SUBDIRS_MENUSELECT_TREE:=$(MOD_SUBDIRS:%=%-menuselect-tree)
307

    
   
307

   
308
ifneq ($(findstring darwin,$(OSARCH)),)
308
ifneq ($(findstring darwin,$(OSARCH)),)
309
  ASTCFLAGS+=-D__Darwin__ -fnested-functions
309
  ASTCFLAGS+=-D__Darwin__ -fnested-functions
310
  SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace
310
  SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace
311
else
311
else
312
# These are used for all but Darwin
312
# These are used for all but Darwin
313
  SOLINK=-shared
313
  SOLINK=-shared
314
  ifneq ($(findstring BSD,$(OSARCH)),)
314
  ifneq ($(findstring BSD,$(OSARCH)),)
315
    LDFLAGS+=-L/usr/local/lib
315
    LDFLAGS+=-L/usr/local/lib
316
  endif
316
  endif
317
endif
317
endif
318

    
   
318

   
319
ifeq ($(OSARCH),SunOS)
319
ifeq ($(OSARCH),SunOS)
320
  SOLINK=-shared -fpic -L/usr/local/ssl/lib -lrt
320
  SOLINK=-shared -fpic -L/usr/local/ssl/lib -lrt
321
endif
321
endif
322

    
   
322

   
323
ifeq ($(OSARCH),OpenBSD)
323
ifeq ($(OSARCH),OpenBSD)
324
  SOLINK=-shared -fpic
324
  SOLINK=-shared -fpic
325
endif
325
endif
326

    
   
326

   
327
# comment to print directories during submakes
327
# comment to print directories during submakes
328
#PRINT_DIR=yes
328
#PRINT_DIR=yes
329

    
   
329

   
330
SILENTMAKE:=$(MAKE) --quiet --no-print-directory
330
SILENTMAKE:=$(MAKE) --quiet --no-print-directory
331
ifneq ($(PRINT_DIR)$(NOISY_BUILD),)
331
ifneq ($(PRINT_DIR)$(NOISY_BUILD),)
332
SUBMAKE:=$(MAKE)
332
SUBMAKE:=$(MAKE)
333
else
333
else
334
SUBMAKE:=$(MAKE) --quiet --no-print-directory
334
SUBMAKE:=$(MAKE) --quiet --no-print-directory
335
endif
335
endif
336

    
   
336

   
337
# This is used when generating the doxygen documentation
337
# This is used when generating the doxygen documentation
338
ifneq ($(DOT),:)
338
ifneq ($(DOT),:)
339
  HAVEDOT=yes
339
  HAVEDOT=yes
340
else
340
else
341
  HAVEDOT=no
341
  HAVEDOT=no
342
endif
342
endif
343

    
   
343

   
344
# $(MAKE) is printed in several places, and we want it to be a
344
# $(MAKE) is printed in several places, and we want it to be a
345
# fixed size string. Define a variable whose name has also the
345
# fixed size string. Define a variable whose name has also the
346
# same size, so we can easily align text.
346
# same size, so we can easily align text.
347
ifeq ($(MAKE), gmake)
347
ifeq ($(MAKE), gmake)
348
	mK="gmake"
348
	mK="gmake"
349
else
349
else
350
	mK=" make"
350
	mK=" make"
351
endif
351
endif
352

    
   
352

   
353
all: _all
353
all: _all
354
	@echo " +--------- Asterisk Build Complete ---------+"  
354
	@echo " +--------- Asterisk Build Complete ---------+"  
355
	@echo " + Asterisk has successfully been built, and +"  
355
	@echo " + Asterisk has successfully been built, and +"  
356
	@echo " + can be installed by running:              +"
356
	@echo " + can be installed by running:              +"
357
	@echo " +                                           +"
357
	@echo " +                                           +"
358
	@echo " +               $(mK) install               +"  
358
	@echo " +               $(mK) install               +"  
359
	@echo " +-------------------------------------------+"  
359
	@echo " +-------------------------------------------+"  
360

    
   
360

   
361
_all: cleantest makeopts $(SUBDIRS) doc/core-en_US.xml
361
_all: cleantest makeopts $(SUBDIRS) doc/core-en_US.xml
362

    
   
362

   
363
makeopts: configure
363
makeopts: configure
364
	@echo "****"
364
	@echo "****"
365
	@echo "**** The configure script must be executed before running '$(MAKE)'." 
365
	@echo "**** The configure script must be executed before running '$(MAKE)'." 
366
	@echo "****               Please run \"./configure\"."
366
	@echo "****               Please run \"./configure\"."
367
	@echo "****"
367
	@echo "****"
368
	@exit 1
368
	@exit 1
369

    
   
369

   
370
menuselect.makeopts: menuselect/menuselect menuselect-tree makeopts
370
menuselect.makeopts: menuselect/menuselect menuselect-tree makeopts
371
	menuselect/menuselect --check-deps menuselect.makeopts $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS)
371
	menuselect/menuselect --check-deps menuselect.makeopts $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS)
372

    
   
372

   
373
$(MOD_SUBDIRS_EMBED_LDSCRIPT):
373
$(MOD_SUBDIRS_EMBED_LDSCRIPT):
374
	@echo "EMBED_LDSCRIPTS+="`$(SILENTMAKE) -C $(@:-embed-ldscript=) SUBDIR=$(@:-embed-ldscript=) __embed_ldscript` >> makeopts.embed_rules
374
	@echo "EMBED_LDSCRIPTS+="`$(SILENTMAKE) -C $(@:-embed-ldscript=) SUBDIR=$(@:-embed-ldscript=) __embed_ldscript` >> makeopts.embed_rules
375

    
   
375

   
376
$(MOD_SUBDIRS_EMBED_LDFLAGS):
376
$(MOD_SUBDIRS_EMBED_LDFLAGS):
377
	@echo "EMBED_LDFLAGS+="`$(SILENTMAKE) -C $(@:-embed-ldflags=) SUBDIR=$(@:-embed-ldflags=) __embed_ldflags` >> makeopts.embed_rules
377
	@echo "EMBED_LDFLAGS+="`$(SILENTMAKE) -C $(@:-embed-ldflags=) SUBDIR=$(@:-embed-ldflags=) __embed_ldflags` >> makeopts.embed_rules
378

    
   
378

   
379
$(MOD_SUBDIRS_EMBED_LIBS):
379
$(MOD_SUBDIRS_EMBED_LIBS):
380
	@echo "EMBED_LIBS+="`$(SILENTMAKE) -C $(@:-embed-libs=) SUBDIR=$(@:-embed-libs=) __embed_libs` >> makeopts.embed_rules
380
	@echo "EMBED_LIBS+="`$(SILENTMAKE) -C $(@:-embed-libs=) SUBDIR=$(@:-embed-libs=) __embed_libs` >> makeopts.embed_rules
381

    
   
381

   
382
$(MOD_SUBDIRS_MENUSELECT_TREE):
382
$(MOD_SUBDIRS_MENUSELECT_TREE):
383
	@$(SUBMAKE) -C $(@:-menuselect-tree=) SUBDIR=$(@:-menuselect-tree=) moduleinfo
383
	@$(SUBMAKE) -C $(@:-menuselect-tree=) SUBDIR=$(@:-menuselect-tree=) moduleinfo
384
	@$(SUBMAKE) -C $(@:-menuselect-tree=) SUBDIR=$(@:-menuselect-tree=) makeopts
384
	@$(SUBMAKE) -C $(@:-menuselect-tree=) SUBDIR=$(@:-menuselect-tree=) makeopts
385

    
   
385

   
386
makeopts.embed_rules: menuselect.makeopts
386
makeopts.embed_rules: menuselect.makeopts
387
	@echo "Generating embedded module rules ..."
387
	@echo "Generating embedded module rules ..."
388
	@rm -f $@
388
	@rm -f $@
389
	@$(SUBMAKE) $(MOD_SUBDIRS_EMBED_LDSCRIPT)
389
	@$(SUBMAKE) $(MOD_SUBDIRS_EMBED_LDSCRIPT)
390
	@$(SUBMAKE) $(MOD_SUBDIRS_EMBED_LDFLAGS)
390
	@$(SUBMAKE) $(MOD_SUBDIRS_EMBED_LDFLAGS)
391
	@$(SUBMAKE) $(MOD_SUBDIRS_EMBED_LIBS)
391
	@$(SUBMAKE) $(MOD_SUBDIRS_EMBED_LIBS)
392

    
   
392

   
393
$(SUBDIRS): main/version.c include/asterisk/version.h include/asterisk/build.h include/asterisk/buildopts.h defaults.h makeopts.embed_rules
393
$(SUBDIRS): main/version.c include/asterisk/version.h include/asterisk/build.h include/asterisk/buildopts.h defaults.h makeopts.embed_rules
394

    
   
394

   
395
ifeq ($(findstring $(OSARCH), mingw32 cygwin ),)
395
ifeq ($(findstring $(OSARCH), mingw32 cygwin ),)
396
    # Non-windows:
396
    # Non-windows:
397
    # ensure that all module subdirectories are processed before 'main' during
397
    # ensure that all module subdirectories are processed before 'main' during
398
    # a parallel build, since if there are modules selected to be embedded the
398
    # a parallel build, since if there are modules selected to be embedded the
399
    # directories containing them must be completed before the main Asterisk
399
    # directories containing them must be completed before the main Asterisk
400
    # binary can be built
400
    # binary can be built
401
main: $(filter-out main,$(MOD_SUBDIRS))
401
main: $(filter-out main,$(MOD_SUBDIRS))
402
else
402
else
403
    # Windows: we need to build main (i.e. the asterisk dll) first,
403
    # Windows: we need to build main (i.e. the asterisk dll) first,
404
    # followed by res, followed by the other directories, because
404
    # followed by res, followed by the other directories, because
405
    # dll symbols must be resolved during linking and not at runtime.
405
    # dll symbols must be resolved during linking and not at runtime.
406
D1:= $(filter-out main,$(MOD_SUBDIRS))
406
D1:= $(filter-out main,$(MOD_SUBDIRS))
407
D1:= $(filter-out res,$(D1))
407
D1:= $(filter-out res,$(D1))
408

    
   
408

   
409
$(D1): res
409
$(D1): res
410
res:	main
410
res:	main
411
endif
411
endif
412

    
   
412

   
413
$(MOD_SUBDIRS):
413
$(MOD_SUBDIRS):
414
	@ASTCFLAGS="$(MOD_SUBDIR_CFLAGS) $(ASTCFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" $(SUBMAKE) --no-builtin-rules -C $@ SUBDIR=$@ all
414
	@ASTCFLAGS="$(MOD_SUBDIR_CFLAGS) $(ASTCFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" $(SUBMAKE) --no-builtin-rules -C $@ SUBDIR=$@ all
415

    
   
415

   
416
$(OTHER_SUBDIRS):
416
$(OTHER_SUBDIRS):
417
	@ASTCFLAGS="$(OTHER_SUBDIR_CFLAGS) $(ASTCFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" $(SUBMAKE) --no-builtin-rules -C $@ SUBDIR=$@ all
417
	@ASTCFLAGS="$(OTHER_SUBDIR_CFLAGS) $(ASTCFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" $(SUBMAKE) --no-builtin-rules -C $@ SUBDIR=$@ all
418

    
   
418

   
419
defaults.h: makeopts
419
defaults.h: makeopts
420
	@build_tools/make_defaults_h > $@.tmp
420
	@build_tools/make_defaults_h > $@.tmp
421
	@cmp -s $@.tmp $@ || mv $@.tmp $@
421
	@cmp -s $@.tmp $@ || mv $@.tmp $@
422
	@rm -f $@.tmp
422
	@rm -f $@.tmp
423

    
   
423

   
424
main/version.c: FORCE
424
main/version.c: FORCE
425
	@build_tools/make_version_c > $@.tmp
425
	@build_tools/make_version_c > $@.tmp
426
	@cmp -s $@.tmp $@ || mv $@.tmp $@
426
	@cmp -s $@.tmp $@ || mv $@.tmp $@
427
	@rm -f $@.tmp
427
	@rm -f $@.tmp
428

    
   
428

   
429
include/asterisk/version.h: FORCE
429
include/asterisk/version.h: FORCE
430
	@build_tools/make_version_h > $@.tmp
430
	@build_tools/make_version_h > $@.tmp
431
	@cmp -s $@.tmp $@ || mv $@.tmp $@
431
	@cmp -s $@.tmp $@ || mv $@.tmp $@
432
	@rm -f $@.tmp
432
	@rm -f $@.tmp
433

    
   
433

   
434
include/asterisk/buildopts.h: menuselect.makeopts
434
include/asterisk/buildopts.h: menuselect.makeopts
435
	@build_tools/make_buildopts_h > $@.tmp
435
	@build_tools/make_buildopts_h > $@.tmp
436
	@cmp -s $@.tmp $@ || mv $@.tmp $@
436
	@cmp -s $@.tmp $@ || mv $@.tmp $@
437
	@rm -f $@.tmp
437
	@rm -f $@.tmp
438

    
   
438

   
439
include/asterisk/build.h:
439
include/asterisk/build.h:
440
	@build_tools/make_build_h > $@.tmp
440
	@build_tools/make_build_h > $@.tmp
441
	@cmp -s $@.tmp $@ || mv $@.tmp $@
441
	@cmp -s $@.tmp $@ || mv $@.tmp $@
442
	@rm -f $@.tmp
442
	@rm -f $@.tmp
443

    
   
443

   
444
$(SUBDIRS_CLEAN):
444
$(SUBDIRS_CLEAN):
445
	@$(SUBMAKE) -C $(@:-clean=) clean
445
	@$(SUBMAKE) -C $(@:-clean=) clean
446

    
   
446

   
447
$(SUBDIRS_DIST_CLEAN):
447
$(SUBDIRS_DIST_CLEAN):
448
	@$(SUBMAKE) -C $(@:-dist-clean=) dist-clean
448
	@$(SUBMAKE) -C $(@:-dist-clean=) dist-clean
449

    
   
449

   
450
clean: $(SUBDIRS_CLEAN) _clean
450
clean: $(SUBDIRS_CLEAN) _clean
451

    
   
451

   
452
_clean:
452
_clean:
453
	rm -f defaults.h
453
	rm -f defaults.h
454
	rm -f include/asterisk/build.h
454
	rm -f include/asterisk/build.h
455
	rm -f main/version.c
455
	rm -f main/version.c
456
	rm -f include/asterisk/version.h
456
	rm -f include/asterisk/version.h
457
	@$(MAKE) -C menuselect clean
457
	@$(MAKE) -C menuselect clean
458
	cp -f .cleancount .lastclean
458
	cp -f .cleancount .lastclean
459

    
   
459

   
460
dist-clean: distclean
460
dist-clean: distclean
461

    
   
461

   
462
distclean: $(SUBDIRS_DIST_CLEAN) _clean
462
distclean: $(SUBDIRS_DIST_CLEAN) _clean
463
	@$(MAKE) -C menuselect dist-clean
463
	@$(MAKE) -C menuselect dist-clean
464
	@$(MAKE) -C sounds dist-clean
464
	@$(MAKE) -C sounds dist-clean
465
	rm -f menuselect.makeopts makeopts menuselect-tree menuselect.makedeps
465
	rm -f menuselect.makeopts makeopts menuselect-tree menuselect.makedeps
466
	rm -f makeopts.embed_rules
466
	rm -f makeopts.embed_rules
467
	rm -f config.log config.status config.cache
467
	rm -f config.log config.status config.cache
468
	rm -rf autom4te.cache
468
	rm -rf autom4te.cache
469
	rm -f include/asterisk/autoconfig.h
469
	rm -f include/asterisk/autoconfig.h
470
	rm -f include/asterisk/buildopts.h
470
	rm -f include/asterisk/buildopts.h
471
	rm -rf doc/api
471
	rm -rf doc/api
472
	rm -f build_tools/menuselect-deps
472
	rm -f build_tools/menuselect-deps
473

    
   
473

   
474
datafiles: _all
474
datafiles: _all
475
	if [ x`$(ID) -un` = xroot ]; then CFLAGS="$(ASTCFLAGS)" sh build_tools/mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; fi
475
	if [ x`$(ID) -un` = xroot ]; then CFLAGS="$(ASTCFLAGS)" sh build_tools/mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; fi
476
# Should static HTTP be installed during make samples or even with its own target ala
476
# Should static HTTP be installed during make samples or even with its own target ala
477
# webvoicemail?  There are portions here that *could* be customized but might also be
477
# webvoicemail?  There are portions here that *could* be customized but might also be
478
# improved a lot.  I'll put it here for now.
478
# improved a lot.  I'll put it here for now.
479
	mkdir -p $(DESTDIR)$(ASTDATADIR)/static-http
479
	mkdir -p $(DESTDIR)$(ASTDATADIR)/static-http
480
	for x in static-http/*; do \
480
	for x in static-http/*; do \
481
		$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/static-http ; \
481
		$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/static-http ; \
482
	done
482
	done
483
	if [ -d doc/tex/asterisk ] ; then \
483
	if [ -d doc/tex/asterisk ] ; then \
484
			mkdir -p $(DESTDIR)$(ASTDATADIR)/static-http/docs ; \
484
			mkdir -p $(DESTDIR)$(ASTDATADIR)/static-http/docs ; \
485
			for n in doc/tex/asterisk/* ; do \
485
			for n in doc/tex/asterisk/* ; do \
486
				$(INSTALL) -m 644 $$n $(DESTDIR)$(ASTDATADIR)/static-http/docs ; \
486
				$(INSTALL) -m 644 $$n $(DESTDIR)$(ASTDATADIR)/static-http/docs ; \
487
			done \
487
			done \
488
	fi
488
	fi
489
	mkdir -p $(DESTDIR)$(ASTDATADIR)/images
489
	mkdir -p $(DESTDIR)$(ASTDATADIR)/images
490
	for x in images/*.jpg; do \
490
	for x in images/*.jpg; do \
491
		$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/images ; \
491
		$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/images ; \
492
	done
492
	done
493
	mkdir -p $(DESTDIR)$(AGI_DIR)
493
	mkdir -p $(DESTDIR)$(AGI_DIR)
494
	$(MAKE) -C sounds install
494
	$(MAKE) -C sounds install
495

    
   
495

   
496
doc/core-en_US.xml: $(foreach dir,$(MOD_SUBDIRS),$(wildcard $(dir)/*.c) $(wildcard $(dir)/*.cc)) 
496
doc/core-en_US.xml: $(foreach dir,$(MOD_SUBDIRS),$(wildcard $(dir)/*.c) $(wildcard $(dir)/*.cc)) 
497
	@echo -n "Building Documentation For: "
497
	@echo -n "Building Documentation For: "
498
	@echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > $@
498
	@echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > $@
499
	@echo "<!DOCTYPE docs SYSTEM \"appdocsxml.dtd\">" >> $@
499
	@echo "<!DOCTYPE docs SYSTEM \"appdocsxml.dtd\">" >> $@
500
	@echo "<docs>" >> $@
500
	@echo "<docs>" >> $@
501
	@for x in $(MOD_SUBDIRS); do \
501
	@for x in $(MOD_SUBDIRS); do \
502
		echo -n "$$x " ; \
502
		echo -n "$$x " ; \
503
		for i in $$x/*.c; do \
503
		for i in $$x/*.c; do \
504
			$(AWK) -f build_tools/get_documentation $$i >> $@ ; \
504
			$(AWK) -f build_tools/get_documentation $$i >> $@ ; \
505
		done ; \
505
		done ; \
506
	done
506
	done
507
	@echo
507
	@echo
508
	@echo "</docs>" >> $@
508
	@echo "</docs>" >> $@
509

    
   
509

   
510
validate-docs: doc/core-en_US.xml
510
validate-docs: doc/core-en_US.xml
511
ifeq ($(XMLSTARLET),:)
511
ifeq ($(XMLSTARLET),:)
512
	@echo "---------------------------------------------------------------"
512
	@echo "---------------------------------------------------------------"
513
	@echo "--- Please install xmlstarlet to validate the documentation ---"
513
	@echo "--- Please install xmlstarlet to validate the documentation ---"
514
	@echo "---------------------------------------------------------------"
514
	@echo "---------------------------------------------------------------"
515
else
515
else
516
	$(XMLSTARLET) val -d doc/appdocsxml.dtd $<
516
	$(XMLSTARLET) val -d doc/appdocsxml.dtd $<
517
endif
517
endif
518

    
   
518

   
519
update: 
519
update: 
520
	@if [ -d .svn ]; then \
520
	@if [ -d .svn ]; then \
521
		echo "Updating from Subversion..." ; \
521
		echo "Updating from Subversion..." ; \
522
		fromrev="`svn info | $(AWK) '/Revision: / {print $$2}'`"; \
522
		fromrev="`svn info | $(AWK) '/Revision: / {print $$2}'`"; \
523
		svn update | tee update.out; \
523
		svn update | tee update.out; \
524
		torev="`svn info | $(AWK) '/Revision: / {print $$2}'`"; \
524
		torev="`svn info | $(AWK) '/Revision: / {print $$2}'`"; \
525
		echo "`date`  Updated from revision $${fromrev} to $${torev}." >> update.log; \
525
		echo "`date`  Updated from revision $${fromrev} to $${torev}." >> update.log; \
526
		rm -f .version; \
526
		rm -f .version; \
527
		if [ `grep -c ^C update.out` -gt 0 ]; then \
527
		if [ `grep -c ^C update.out` -gt 0 ]; then \
528
			echo ; echo "The following files have conflicts:" ; \
528
			echo ; echo "The following files have conflicts:" ; \
529
			grep ^C update.out | cut -b4- ; \
529
			grep ^C update.out | cut -b4- ; \
530
		fi ; \
530
		fi ; \
531
		rm -f update.out; \
531
		rm -f update.out; \
532
	else \
532
	else \
533
		echo "Not under version control";  \
533
		echo "Not under version control";  \
534
	fi
534
	fi
535

    
   
535

   
536
NEWHEADERS=$(notdir $(wildcard include/asterisk/*.h))
536
NEWHEADERS=$(notdir $(wildcard include/asterisk/*.h))
537
OLDHEADERS=$(filter-out $(NEWHEADERS),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h)))
537
OLDHEADERS=$(filter-out $(NEWHEADERS),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h)))
538

    
   
538

   
539
installdirs:
539
installdirs:
540
	mkdir -p $(DESTDIR)$(MODULES_DIR)
540
	mkdir -p $(DESTDIR)$(MODULES_DIR)
541
	mkdir -p $(DESTDIR)$(ASTSBINDIR)
541
	mkdir -p $(DESTDIR)$(ASTSBINDIR)
542
	mkdir -p $(DESTDIR)$(ASTETCDIR)
542
	mkdir -p $(DESTDIR)$(ASTETCDIR)
543
	mkdir -p $(DESTDIR)$(ASTBINDIR)
543
	mkdir -p $(DESTDIR)$(ASTBINDIR)
544
	mkdir -p $(DESTDIR)$(ASTVARRUNDIR)
544
	mkdir -p $(DESTDIR)$(ASTVARRUNDIR)
545
	mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail
545
	mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail
546
	mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/dictate
546
	mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/dictate
547
	mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/system
547
	mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/system
548
	mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/tmp
548
	mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/tmp
549
	mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/meetme
549
	mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/meetme
550
	mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/monitor
550
	mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/monitor
551

    
   
551

   
552
bininstall: _all installdirs $(SUBDIRS_INSTALL)
552
bininstall: _all installdirs $(SUBDIRS_INSTALL)
553
	$(INSTALL) -m 755 main/asterisk $(DESTDIR)$(ASTSBINDIR)/
553
	$(INSTALL) -m 755 main/asterisk $(DESTDIR)$(ASTSBINDIR)/
554
	$(LN) -sf asterisk $(DESTDIR)$(ASTSBINDIR)/rasterisk
554
	$(LN) -sf asterisk $(DESTDIR)$(ASTSBINDIR)/rasterisk
555
	$(INSTALL) -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
555
	$(INSTALL) -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
556
	$(INSTALL) -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
556
	$(INSTALL) -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
557
	if [ ! -f $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ]; then \
557
	if [ ! -f $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ]; then \
558
		cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
558
		cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
559
		chmod 755 $(DESTDIR)$(ASTSBINDIR)/safe_asterisk;\
559
		chmod 755 $(DESTDIR)$(ASTSBINDIR)/safe_asterisk;\
560
	fi
560
	fi
561
	$(INSTALL) -d $(DESTDIR)$(ASTHEADERDIR)
561
	$(INSTALL) -d $(DESTDIR)$(ASTHEADERDIR)
562
	$(INSTALL) -m 644 include/asterisk.h $(DESTDIR)$(includedir)
562
	$(INSTALL) -m 644 include/asterisk.h $(DESTDIR)$(includedir)
563
	$(INSTALL) -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
563
	$(INSTALL) -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
564
	if [ -n "$(OLDHEADERS)" ]; then \
564
	if [ -n "$(OLDHEADERS)" ]; then \
565
		rm -f $(addprefix $(DESTDIR)$(ASTHEADERDIR)/,$(OLDHEADERS)) ;\
565
		rm -f $(addprefix $(DESTDIR)$(ASTHEADERDIR)/,$(OLDHEADERS)) ;\
566
	fi
566
	fi
567
	mkdir -p $(DESTDIR)$(ASTDATADIR)/documentation
567
	mkdir -p $(DESTDIR)$(ASTDATADIR)/documentation
568
	mkdir -p $(DESTDIR)$(ASTDATADIR)/documentation/thirdparty
568
	mkdir -p $(DESTDIR)$(ASTDATADIR)/documentation/thirdparty
569
	mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
569
	mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
570
	mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-custom
570
	mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-custom
571
	mkdir -p $(DESTDIR)$(ASTDATADIR)/keys
571
	mkdir -p $(DESTDIR)$(ASTDATADIR)/keys
572
	mkdir -p $(DESTDIR)$(ASTDATADIR)/firmware
572
	mkdir -p $(DESTDIR)$(ASTDATADIR)/firmware
573
	mkdir -p $(DESTDIR)$(ASTDATADIR)/firmware/iax
573
	mkdir -p $(DESTDIR)$(ASTDATADIR)/firmware/iax
574
	mkdir -p $(DESTDIR)$(ASTMANDIR)/man8
574
	mkdir -p $(DESTDIR)$(ASTMANDIR)/man8
575
	$(INSTALL) -m 644 doc/core-*.xml $(DESTDIR)$(ASTDATADIR)/documentation
575
	$(INSTALL) -m 644 doc/core-*.xml $(DESTDIR)$(ASTDATADIR)/documentation
576
	$(INSTALL) -m 644 doc/appdocsxml.dtd $(DESTDIR)$(ASTVARLIBDIR)/documentation
576
	$(INSTALL) -m 644 doc/appdocsxml.dtd $(DESTDIR)$(ASTVARLIBDIR)/documentation
577
	$(INSTALL) -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTDATADIR)/keys
577
	$(INSTALL) -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTDATADIR)/keys
578
	$(INSTALL) -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTDATADIR)/keys
578
	$(INSTALL) -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTDATADIR)/keys
579
	$(INSTALL) -m 644 doc/asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
579
	$(INSTALL) -m 644 doc/asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
580
	$(INSTALL) -m 644 contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8
580
	$(INSTALL) -m 644 contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8
581
	$(INSTALL) -m 644 contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8
581
	$(INSTALL) -m 644 contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8
582
	$(INSTALL) -m 644 contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
582
	$(INSTALL) -m 644 contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
583
	if [ -f contrib/firmware/iax/iaxy.bin ] ; then \
583
	if [ -f contrib/firmware/iax/iaxy.bin ] ; then \
584
		$(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTDATADIR)/firmware/iax/iaxy.bin; \
584
		$(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTDATADIR)/firmware/iax/iaxy.bin; \
585
	fi
585
	fi
586

    
   
586

   
587
$(SUBDIRS_INSTALL):
587
$(SUBDIRS_INSTALL):
588
	@DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" $(SUBMAKE) -C $(@:-install=) install
588
	@DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" $(SUBMAKE) -C $(@:-install=) install
589

    
   
589

   
590
NEWMODS:=$(foreach d,$(MOD_SUBDIRS),$(notdir $(wildcard $(d)/*.so)))
590
NEWMODS:=$(foreach d,$(MOD_SUBDIRS),$(notdir $(wildcard $(d)/*.so)))
591
OLDMODS=$(filter-out $(NEWMODS),$(notdir $(wildcard $(DESTDIR)$(MODULES_DIR)/*.so)))
591
OLDMODS=$(filter-out $(NEWMODS),$(notdir $(wildcard $(DESTDIR)$(MODULES_DIR)/*.so)))
592

    
   
592

   
593
oldmodcheck:
593
oldmodcheck:
594
	@if [ -n "$(OLDMODS)" ]; then \
594
	@if [ -n "$(OLDMODS)" ]; then \
595
		echo " WARNING WARNING WARNING" ;\
595
		echo " WARNING WARNING WARNING" ;\
596
		echo "" ;\
596
		echo "" ;\
597
		echo " Your Asterisk modules directory, located at" ;\
597
		echo " Your Asterisk modules directory, located at" ;\
598
		echo " $(DESTDIR)$(MODULES_DIR)" ;\
598
		echo " $(DESTDIR)$(MODULES_DIR)" ;\
599
		echo " contains modules that were not installed by this " ;\
599
		echo " contains modules that were not installed by this " ;\
600
		echo " version of Asterisk. Please ensure that these" ;\
600
		echo " version of Asterisk. Please ensure that these" ;\
601
		echo " modules are compatible with this version before" ;\
601
		echo " modules are compatible with this version before" ;\
602
		echo " attempting to run Asterisk." ;\
602
		echo " attempting to run Asterisk." ;\
603
		echo "" ;\
603
		echo "" ;\
604
		for f in $(OLDMODS); do \
604
		for f in $(OLDMODS); do \
605
			echo "    $$f" ;\
605
			echo "    $$f" ;\
606
		done ;\
606
		done ;\
607
		echo "" ;\
607
		echo "" ;\
608
		echo " WARNING WARNING WARNING" ;\
608
		echo " WARNING WARNING WARNING" ;\
609
	fi
609
	fi
610

    
   
610

   
611
badshell:
611
badshell:
612
ifneq ($(findstring ~,$(DESTDIR)),)
612
ifneq ($(findstring ~,$(DESTDIR)),)
613
	@echo "Your shell doesn't do ~ expansion when expected (specifically, when doing \"make install DESTDIR=~/path\")."
613
	@echo "Your shell doesn't do ~ expansion when expected (specifically, when doing \"make install DESTDIR=~/path\")."
614
	@echo "Try replacing ~ with \$$HOME, as in \"make install DESTDIR=\$$HOME/path\"."
614
	@echo "Try replacing ~ with \$$HOME, as in \"make install DESTDIR=\$$HOME/path\"."
615
	@exit 1
615
	@exit 1
616
endif
616
endif
617

    
   
617

   
618
install: badshell datafiles bininstall
618
install: badshell datafiles bininstall
619
	@if [ -x /usr/sbin/asterisk-post-install ]; then \
619
	@if [ -x /usr/sbin/asterisk-post-install ]; then \
620
		/usr/sbin/asterisk-post-install $(DESTDIR) . ; \
620
		/usr/sbin/asterisk-post-install $(DESTDIR) . ; \
621
	fi
621
	fi
622
	@echo " +---- Asterisk Installation Complete -------+"  
622
	@echo " +---- Asterisk Installation Complete -------+"  
623
	@echo " +                                           +"
623
	@echo " +                                           +"
624
	@echo " +    YOU MUST READ THE SECURITY DOCUMENT    +"
624
	@echo " +    YOU MUST READ THE SECURITY DOCUMENT    +"
625
	@echo " +                                           +"
625
	@echo " +                                           +"
626
	@echo " + Asterisk has successfully been installed. +"  
626
	@echo " + Asterisk has successfully been installed. +"  
627
	@echo " + If you would like to install the sample   +"  
627
	@echo " + If you would like to install the sample   +"  
628
	@echo " + configuration files (overwriting any      +"
628
	@echo " + configuration files (overwriting any      +"
629
	@echo " + existing config files), run:              +"  
629
	@echo " + existing config files), run:              +"  
630
	@echo " +                                           +"
630
	@echo " +                                           +"
631
	@echo " +               $(mK) samples               +"
631
	@echo " +               $(mK) samples               +"
632
	@echo " +                                           +"
632
	@echo " +                                           +"
633
	@echo " +-----------------  or ---------------------+"
633
	@echo " +-----------------  or ---------------------+"
634
	@echo " +                                           +"
634
	@echo " +                                           +"
635
	@echo " + You can go ahead and install the asterisk +"
635
	@echo " + You can go ahead and install the asterisk +"
636
	@echo " + program documentation now or later run:   +"
636
	@echo " + program documentation now or later run:   +"
637
	@echo " +                                           +"
637
	@echo " +                                           +"
638
	@echo " +              $(mK) progdocs               +"
638
	@echo " +              $(mK) progdocs               +"
639
	@echo " +                                           +"
639
	@echo " +                                           +"
640
	@echo " + **Note** This requires that you have      +"
640
	@echo " + **Note** This requires that you have      +"
641
	@echo " + doxygen installed on your local system    +"
641
	@echo " + doxygen installed on your local system    +"
642
	@echo " +-------------------------------------------+"
642
	@echo " +-------------------------------------------+"
643
	@$(MAKE) -s oldmodcheck
643
	@$(MAKE) -s oldmodcheck
644

    
   
644

   
645
isntall: install
645
isntall: install
646

    
   
646

   
647
upgrade: bininstall
647
upgrade: bininstall
648

    
   
648

   
649
# XXX why *.adsi is installed first ?
649
# XXX why *.adsi is installed first ?
650
adsi:
650
adsi:
651
	@echo Installing adsi config files...
651
	@echo Installing adsi config files...
652
	@mkdir -p $(DESTDIR)$(ASTETCDIR)
652
	@mkdir -p $(DESTDIR)$(ASTETCDIR)
653
	@for x in configs/*.adsi; do \
653
	@for x in configs/*.adsi; do \
654
		dst="$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x`" ; \
654
		dst="$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x`" ; \
655
		if [ -f $${dst} ] ; then \
655
		if [ -f $${dst} ] ; then \
656
			echo "Overwriting $$x" ; \
656
			echo "Overwriting $$x" ; \
657
		else \
657
		else \
658
			echo "Installing $$x" ; \
658
			echo "Installing $$x" ; \
659
		fi ; \
659
		fi ; \
660
		$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x` ; \
660
		$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x` ; \
661
	done
661
	done
662

    
   
662

   
663
samples: adsi
663
samples: adsi
664
	@echo Installing other config files...
664
	@echo Installing other config files...
665
	@mkdir -p $(DESTDIR)$(ASTETCDIR)
665
	@mkdir -p $(DESTDIR)$(ASTETCDIR)
666
	@for x in configs/*.sample; do \
666
	@for x in configs/*.sample; do \
667
		dst="$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`" ;	\
667
		dst="$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`" ;	\
668
		if [ -f $${dst} ]; then \
668
		if [ -f $${dst} ]; then \
669
			if [ "$(OVERWRITE)" = "y" ]; then \
669
			if [ "$(OVERWRITE)" = "y" ]; then \
670
				if cmp -s $${dst} $$x ; then \
670
				if cmp -s $${dst} $$x ; then \
671
					echo "Config file $$x is unchanged"; \
671
					echo "Config file $$x is unchanged"; \
672
					continue; \
672
					continue; \
673
				fi ; \
673
				fi ; \
674
				mv -f $${dst} $${dst}.old ; \
674
				mv -f $${dst} $${dst}.old ; \
675
			else \
675
			else \
676
				echo "Skipping config file $$x"; \
676
				echo "Skipping config file $$x"; \
677
				continue; \
677
				continue; \
678
			fi ;\
678
			fi ;\
679
		fi ; \
679
		fi ; \
680
		echo "Installing file $$x"; \
680
		echo "Installing file $$x"; \
681
		$(INSTALL) -m 644 $$x $${dst} ;\
681
		$(INSTALL) -m 644 $$x $${dst} ;\
682
	done
682
	done
683
	@if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
683
	@if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
684
		echo "Creating asterisk.conf"; \
684
		echo "Creating asterisk.conf"; \
685
		( \
685
		( \
686
		echo "[directories](!) ; remove the (!) to enable this" ; \
686
		echo "[directories](!) ; remove the (!) to enable this" ; \
687
		echo "astetcdir => $(ASTETCDIR)" ; \
687
		echo "astetcdir => $(ASTETCDIR)" ; \
688
		echo "astmoddir => $(MODULES_DIR)" ; \
688
		echo "astmoddir => $(MODULES_DIR)" ; \
689
		echo "astvarlibdir => $(ASTVARLIBDIR)" ; \
689
		echo "astvarlibdir => $(ASTVARLIBDIR)" ; \
690
		echo "astdbdir => $(ASTDBDIR)" ; \
690
		echo "astdbdir => $(ASTDBDIR)" ; \
691
		echo "astkeydir => $(ASTKEYDIR)" ; \
691
		echo "astkeydir => $(ASTKEYDIR)" ; \
692
		echo "astdatadir => $(ASTDATADIR)" ; \
692
		echo "astdatadir => $(ASTDATADIR)" ; \
693
		echo "astagidir => $(AGI_DIR)" ; \
693
		echo "astagidir => $(AGI_DIR)" ; \
694
		echo "astspooldir => $(ASTSPOOLDIR)" ; \
694
		echo "astspooldir => $(ASTSPOOLDIR)" ; \
695
		echo "astrundir => $(ASTVARRUNDIR)" ; \
695
		echo "astrundir => $(ASTVARRUNDIR)" ; \
696
		echo "astlogdir => $(ASTLOGDIR)" ; \
696
		echo "astlogdir => $(ASTLOGDIR)" ; \
697
		echo "" ; \
697
		echo "" ; \
698
		echo "[options]" ; \
698
		echo "[options]" ; \
699
		echo ";verbose = 3" ; \
699
		echo ";verbose = 3" ; \
700
		echo ";debug = 3" ; \
700
		echo ";debug = 3" ; \
701
		echo ";alwaysfork = yes ; same as -F at startup" ; \
701
		echo ";alwaysfork = yes ; same as -F at startup" ; \
702
		echo ";nofork = yes ; same as -f at startup" ; \
702
		echo ";nofork = yes ; same as -f at startup" ; \
703
		echo ";quiet = yes ; same as -q at startup" ; \
703
		echo ";quiet = yes ; same as -q at startup" ; \
704
		echo ";timestamp = yes ; same as -T at startup" ; \
704
		echo ";timestamp = yes ; same as -T at startup" ; \
705
		echo ";execincludes = yes ; support #exec in config files" ; \
705
		echo ";execincludes = yes ; support #exec in config files" ; \
706
		echo ";console = yes ; Run as console (same as -c at startup)" ; \
706
		echo ";console = yes ; Run as console (same as -c at startup)" ; \
707
		echo ";highpriority = yes ; Run realtime priority (same as -p at startup)" ; \
707
		echo ";highpriority = yes ; Run realtime priority (same as -p at startup)" ; \
708
		echo ";initcrypto = yes ; Initialize crypto keys (same as -i at startup)" ; \
708
		echo ";initcrypto = yes ; Initialize crypto keys (same as -i at startup)" ; \
709
		echo ";nocolor = yes ; Disable console colors" ; \
709
		echo ";nocolor = yes ; Disable console colors" ; \
710
		echo ";dontwarn = yes ; Disable some warnings" ; \
710
		echo ";dontwarn = yes ; Disable some warnings" ; \
711
		echo ";dumpcore = yes ; Dump core on crash (same as -g at startup)" ; \
711
		echo ";dumpcore = yes ; Dump core on crash (same as -g at startup)" ; \
712
		echo ";languageprefix = yes ; Use the new sound prefix path syntax" ; \
712
		echo ";languageprefix = yes ; Use the new sound prefix path syntax" ; \
713
		echo ";internal_timing = yes" ; \
713
		echo ";internal_timing = yes" ; \
714
		echo ";systemname = my_system_name ; prefix uniqueid with a system name for global uniqueness issues" ; \
714
		echo ";systemname = my_system_name ; prefix uniqueid with a system name for global uniqueness issues" ; \
715
		echo ";autosystemname = yes ; automatically set systemname to hostname - uses 'localhost' on failure, or systemname if set" ; \
715
		echo ";autosystemname = yes ; automatically set systemname to hostname - uses 'localhost' on failure, or systemname if set" ; \
716
		echo ";maxcalls = 10 ; Maximum amount of calls allowed" ; \
716
		echo ";maxcalls = 10 ; Maximum amount of calls allowed" ; \
717
		echo ";maxload = 0.9 ; Asterisk stops accepting new calls if the load average exceed this limit" ; \
717
		echo ";maxload = 0.9 ; Asterisk stops accepting new calls if the load average exceed this limit" ; \
718
		echo ";maxfiles = 1000 ; Maximum amount of openfiles" ; \
718
		echo ";maxfiles = 1000 ; Maximum amount of openfiles" ; \
719
		echo ";minmemfree = 1 ; in MBs, Asterisk stops accepting new calls if the amount of free memory falls below this watermark" ; \
719
		echo ";minmemfree = 1 ; in MBs, Asterisk stops accepting new calls if the amount of free memory falls below this watermark" ; \
720
		echo ";cache_record_files = yes ; Cache recorded sound files to another directory during recording" ; \
720
		echo ";cache_record_files = yes ; Cache recorded sound files to another directory during recording" ; \
721
		echo ";record_cache_dir = /tmp ; Specify cache directory (used in cnjunction with cache_record_files)" ; \
721
		echo ";record_cache_dir = /tmp ; Specify cache directory (used in cnjunction with cache_record_files)" ; \
722
		echo ";transmit_silence_during_record = yes ; Transmit SLINEAR silence while a channel is being recorded" ; \
722
		echo ";transmit_silence_during_record = yes ; Transmit SLINEAR silence while a channel is being recorded" ; \
723
		echo ";transmit_silence = yes ; Transmit SLINEAR silence while a channel is being recorded or DTMF is being generated" ; \
723
		echo ";transmit_silence = yes ; Transmit SLINEAR silence while a channel is being recorded or DTMF is being generated" ; \
724
		echo ";transcode_via_sln = yes ; Build transcode paths via SLINEAR, instead of directly" ; \
724
		echo ";transcode_via_sln = yes ; Build transcode paths via SLINEAR, instead of directly" ; \
725
		echo ";runuser = asterisk ; The user to run as" ; \
725
		echo ";runuser = asterisk ; The user to run as" ; \
726
		echo ";rungroup = asterisk ; The group to run as" ; \
726
		echo ";rungroup = asterisk ; The group to run as" ; \
727
		echo ";lightbackground = yes ; If your terminal is set for a light-colored background" ; \
727
		echo ";lightbackground = yes ; If your terminal is set for a light-colored background" ; \
728
		echo "documentation_language = en_US ; Set the Language you want Documentation displayed in. Value is in the same format as locale names" ; \
728
		echo "documentation_language = en_US ; Set the Language you want Documentation displayed in. Value is in the same format as locale names" ; \
729
		echo ";hideconnect = yes ; Hide messages displayed when a remote console connects and disconnects" ; \
729
		echo ";hideconnect = yes ; Hide messages displayed when a remote console connects and disconnects" ; \
730
		echo "" ; \
730
		echo "" ; \
731
		echo "; Changing the following lines may compromise your security." ; \
731
		echo "; Changing the following lines may compromise your security." ; \
732
		echo ";[files]" ; \
732
		echo ";[files]" ; \
733
		echo ";astctlpermissions = 0660" ; \
733
		echo ";astctlpermissions = 0660" ; \
734
		echo ";astctlowner = root" ; \
734
		echo ";astctlowner = root" ; \
735
		echo ";astctlgroup = apache" ; \
735
		echo ";astctlgroup = apache" ; \
736
		echo ";astctl = asterisk.ctl" ; \
736
		echo ";astctl = asterisk.ctl" ; \
737
		echo "" ; \
737
		echo "" ; \
738
		echo "[compat]" ; \
738
		echo "[compat]" ; \
739
		echo "pbx_realtime=1.6" ; \
739
		echo "pbx_realtime=1.6" ; \
740
		echo "res_agi=1.6" ; \
740
		echo "res_agi=1.6" ; \
741
		echo "app_set=1.6" ; \
741
		echo "app_set=1.6" ; \
742
		) > $(DESTDIR)$(ASTCONFPATH) ; \
742
		) > $(DESTDIR)$(ASTCONFPATH) ; \
743
	else \
743
	else \
744
		echo "Skipping asterisk.conf creation"; \
744
		echo "Skipping asterisk.conf creation"; \
745
	fi
745
	fi
746
	mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX
746
	mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX
747
	build_tools/make_sample_voicemail $(DESTDIR)/$(ASTDATADIR) $(DESTDIR)/$(ASTSPOOLDIR)
747
	build_tools/make_sample_voicemail $(DESTDIR)/$(ASTDATADIR) $(DESTDIR)/$(ASTSPOOLDIR)
748
	@mkdir -p $(DESTDIR)$(ASTDATADIR)/phoneprov
748
	@mkdir -p $(DESTDIR)$(ASTDATADIR)/phoneprov
749
	@for x in phoneprov/*; do \
749
	@for x in phoneprov/*; do \
750
		dst="$(DESTDIR)$(ASTDATADIR)/$$x" ;	\
750
		dst="$(DESTDIR)$(ASTDATADIR)/$$x" ;	\
751
		if [ -f $${dst} ]; then \
751
		if [ -f $${dst} ]; then \
752
			if [ "$(OVERWRITE)" = "y" ]; then \
752
			if [ "$(OVERWRITE)" = "y" ]; then \
753
				if cmp -s $${dst} $$x ; then \
753
				if cmp -s $${dst} $$x ; then \
754
					echo "Config file $$x is unchanged"; \
754
					echo "Config file $$x is unchanged"; \
755
					continue; \
755
					continue; \
756
				fi ; \
756
				fi ; \
757
				mv -f $${dst} $${dst}.old ; \
757
				mv -f $${dst} $${dst}.old ; \
758
			else \
758
			else \
759
				echo "Skipping config file $$x"; \
759
				echo "Skipping config file $$x"; \
760
				continue; \
760
				continue; \
761
			fi ;\
761
			fi ;\
762
		fi ; \
762
		fi ; \
763
		echo "Installing file $$x"; \
763
		echo "Installing file $$x"; \
764
		$(INSTALL) -m 644 $$x $${dst} ;\
764
		$(INSTALL) -m 644 $$x $${dst} ;\
765
	done
765
	done
766

    
   
766

   
767
webvmail:
767
webvmail:
768
	@[ -d $(DESTDIR)$(HTTP_DOCSDIR)/ ] || ( printf "http docs directory not found.\nUpdate assignment of variable HTTP_DOCSDIR in Makefile!\n" && exit 1 )
768
	@[ -d $(DESTDIR)$(HTTP_DOCSDIR)/ ] || ( printf "http docs directory not found.\nUpdate assignment of variable HTTP_DOCSDIR in Makefile!\n" && exit 1 )
769
	@[ -d $(DESTDIR)$(HTTP_CGIDIR) ] || ( printf "cgi-bin directory not found.\nUpdate assignment of variable HTTP_CGIDIR in Makefile!\n" && exit 1 )
769
	@[ -d $(DESTDIR)$(HTTP_CGIDIR) ] || ( printf "cgi-bin directory not found.\nUpdate assignment of variable HTTP_CGIDIR in Makefile!\n" && exit 1 )
770
	$(INSTALL) -m 4755 -o root -g root contrib/scripts/vmail.cgi $(DESTDIR)$(HTTP_CGIDIR)/vmail.cgi
770
	$(INSTALL) -m 4755 -o root -g root contrib/scripts/vmail.cgi $(DESTDIR)$(HTTP_CGIDIR)/vmail.cgi
771
	mkdir -p $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk
771
	mkdir -p $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk
772
	for x in images/*.gif; do \
772
	for x in images/*.gif; do \
773
		$(INSTALL) -m 644 $$x $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk/; \
773
		$(INSTALL) -m 644 $$x $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk/; \
774
	done
774
	done
775
	@echo " +--------- Asterisk Web Voicemail ----------+"  
775
	@echo " +--------- Asterisk Web Voicemail ----------+"  
776
	@echo " +                                           +"
776
	@echo " +                                           +"
777
	@echo " + Asterisk Web Voicemail is installed in    +"
777
	@echo " + Asterisk Web Voicemail is installed in    +"
778
	@echo " + your cgi-bin directory:                   +"
778
	@echo " + your cgi-bin directory:                   +"
779
	@echo " + $(DESTDIR)$(HTTP_CGIDIR)"
779
	@echo " + $(DESTDIR)$(HTTP_CGIDIR)"
780
	@echo " + IT USES A SETUID ROOT PERL SCRIPT, SO     +"
780
	@echo " + IT USES A SETUID ROOT PERL SCRIPT, SO     +"
781
	@echo " + IF YOU DON'T LIKE THAT, UNINSTALL IT!     +"
781
	@echo " + IF YOU DON'T LIKE THAT, UNINSTALL IT!     +"
782
	@echo " +                                           +"
782
	@echo " +                                           +"
783
	@echo " + Other static items have been stored in:   +"
783
	@echo " + Other static items have been stored in:   +"
784
	@echo " + $(DESTDIR)$(HTTP_DOCSDIR)"
784
	@echo " + $(DESTDIR)$(HTTP_DOCSDIR)"
785
	@echo " +                                           +"
785
	@echo " +                                           +"
786
	@echo " + If these paths do not match your httpd    +"
786
	@echo " + If these paths do not match your httpd    +"
787
	@echo " + installation, correct the definitions     +"
787
	@echo " + installation, correct the definitions     +"
788
	@echo " + in your Makefile of HTTP_CGIDIR and       +"
788
	@echo " + in your Makefile of HTTP_CGIDIR and       +"
789
	@echo " + HTTP_DOCSDIR                              +"
789
	@echo " + HTTP_DOCSDIR                              +"
790
	@echo " +                                           +"
790
	@echo " +                                           +"
791
	@echo " +-------------------------------------------+"  
791
	@echo " +-------------------------------------------+"  
792

    
   
792

   
793
progdocs:
793
progdocs:
794
	(cat contrib/asterisk-ng-doxygen; echo "HAVE_DOT=$(HAVEDOT)"; \
794
	(cat contrib/asterisk-ng-doxygen; echo "HAVE_DOT=$(HAVEDOT)"; \
795
	echo "PROJECT_NUMBER=$(ASTERISKVERSION)") | doxygen - 
795
	echo "PROJECT_NUMBER=$(ASTERISKVERSION)") | doxygen - 
796

    
   
796

   
797
install-logrotate:
797
install-logrotate:
798
	if [ ! -d $(ASTETCDIR)/../logrotate.d ]; then \
798
	if [ ! -d $(ASTETCDIR)/../logrotate.d ]; then \
799
		mkdir $(ASTETCDIR)/../logrotate.d ; \
799
		mkdir $(ASTETCDIR)/../logrotate.d ; \
800
	fi
800
	fi
801
	sed 's#__LOGDIR__#$(ASTLOGDIR)#g' < contrib/scripts/asterisk.logrotate | sed 's#__SBINDIR__#$(ASTSBINDIR)#g' > contrib/scripts/asterisk.logrotate.tmp
801
	sed 's#__LOGDIR__#$(ASTLOGDIR)#g' < contrib/scripts/asterisk.logrotate | sed 's#__SBINDIR__#$(ASTSBINDIR)#g' > contrib/scripts/asterisk.logrotate.tmp
802
	install -m 0644 contrib/scripts/asterisk.logrotate.tmp $(ASTETCDIR)/../logrotate.d/asterisk
802
	install -m 0644 contrib/scripts/asterisk.logrotate.tmp $(ASTETCDIR)/../logrotate.d/asterisk
803
	rm -f contrib/scripts/asterisk.logrotate.tmp
803
	rm -f contrib/scripts/asterisk.logrotate.tmp
804

    
   
804

   
805
config:
805
config:
806
	@if [ "${OSARCH}" = "linux-gnu" ]; then \
806
	@if [ "${OSARCH}" = "linux-gnu" ]; then \
807
		if [ -f /etc/redhat-release -o -f /etc/fedora-release ]; then \
807
		if [ -f /etc/redhat-release -o -f /etc/fedora-release ]; then \
808
			cat contrib/init.d/rc.redhat.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR);s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)/etc/rc.d/init.d/asterisk ;\
808
			cat contrib/init.d/rc.redhat.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR);s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)/etc/rc.d/init.d/asterisk ;\
809
			chmod 755 $(DESTDIR)/etc/rc.d/init.d/asterisk;\
809
			chmod 755 $(DESTDIR)/etc/rc.d/init.d/asterisk;\
810
			if [ -z "$(DESTDIR)" ]; then /sbin/chkconfig --add asterisk; fi; \
810
			if [ -z "$(DESTDIR)" ]; then /sbin/chkconfig --add asterisk; fi; \
811
		elif [ -f /etc/debian_version ]; then \
811
		elif [ -f /etc/debian_version ]; then \
812
			cat contrib/init.d/rc.debian.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR);s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)/etc/init.d/asterisk ;\
812
			cat contrib/init.d/rc.debian.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR);s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)/etc/init.d/asterisk ;\
813
			chmod 755 $(DESTDIR)/etc/init.d/asterisk;\
813
			chmod 755 $(DESTDIR)/etc/init.d/asterisk;\
814
			if [ -z "$(DESTDIR)" ]; then /usr/sbin/update-rc.d asterisk start 50 2 3 4 5 . stop 91 2 3 4 5 .; fi; \
814
			if [ -z "$(DESTDIR)" ]; then /usr/sbin/update-rc.d asterisk start 50 2 3 4 5 . stop 91 2 3 4 5 .; fi; \
815
		elif [ -f /etc/gentoo-release ]; then \
815
		elif [ -f /etc/gentoo-release ]; then \
816
			cat contrib/init.d/rc.gentoo.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR);s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)/etc/init.d/asterisk ;\
816
			cat contrib/init.d/rc.gentoo.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR);s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)/etc/init.d/asterisk ;\
817
			chmod 755 $(DESTDIR)/etc/init.d/asterisk;\
817
			chmod 755 $(DESTDIR)/etc/init.d/asterisk;\
818
			if [ -z "$(DESTDIR)" ]; then /sbin/rc-update add asterisk default; fi; \
818
			if [ -z "$(DESTDIR)" ]; then /sbin/rc-update add asterisk default; fi; \
819
		elif [ -f /etc/mandrake-release -o -f /etc/mandriva-release ]; then \
819
		elif [ -f /etc/mandrake-release -o -f /etc/mandriva-release ]; then \
820
			cat contrib/init.d/rc.mandriva.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR);s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)/etc/rc.d/init.d/asterisk ;\
820
			cat contrib/init.d/rc.mandriva.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR);s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)/etc/rc.d/init.d/asterisk ;\
821
			chmod 755 $(DESTDIR)/etc/rc.d/init.d/asterisk;\
821
			chmod 755 $(DESTDIR)/etc/rc.d/init.d/asterisk;\
822
			if [ -z "$(DESTDIR)" ]; then /sbin/chkconfig --add asterisk; fi; \
822
			if [ -z "$(DESTDIR)" ]; then /sbin/chkconfig --add asterisk; fi; \
823
		elif [ -f /etc/SuSE-release -o -f /etc/novell-release ]; then \
823
		elif [ -f /etc/SuSE-release -o -f /etc/novell-release ]; then \
824
			cat contrib/init.d/rc.suse.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR);s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)/etc/init.d/asterisk ;\
824
			cat contrib/init.d/rc.suse.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR);s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)/etc/init.d/asterisk ;\
825
			chmod 755 $(DESTDIR)/etc/init.d/asterisk;\
825
			chmod 755 $(DESTDIR)/etc/init.d/asterisk;\
826
			if [ -z "$(DESTDIR)" ]; then /sbin/chkconfig --add asterisk; fi; \
826
			if [ -z "$(DESTDIR)" ]; then /sbin/chkconfig --add asterisk; fi; \
827
		elif [ -f /etc/arch-release -o -f /etc/arch-release ]; then \
827
		elif [ -f /etc/arch-release -o -f /etc/arch-release ]; then \
828
			cat contrib/init.d/rc.archlinux.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR);s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)/etc/rc.d/asterisk ;\
828
			cat contrib/init.d/rc.archlinux.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR);s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)/etc/rc.d/asterisk ;\
829
			chmod 755 $(DESTDIR)/etc/rc.d/asterisk;\
829
			chmod 755 $(DESTDIR)/etc/rc.d/asterisk;\
830
		elif [ -f /etc/slackware-version ]; then \
830
		elif [ -f /etc/slackware-version ]; then \
831
			echo "Slackware is not currently supported, although an init script does exist for it." \
831
			echo "Slackware is not currently supported, although an init script does exist for it." \
832
		else \
832
		else \
833
			echo "We could not install init scripts for your distribution."; \
833
			echo "We could not install init scripts for your distribution."; \
834
		fi \
834
		fi \
835
	else \
835
	else \
836
		echo "We could not install init scripts for your operating system."; \
836
		echo "We could not install init scripts for your operating system."; \
837
	fi
837
	fi
838

    
   
838

   
839
sounds:
839
sounds:
840
	$(MAKE) -C sounds all
840
	$(MAKE) -C sounds all
841

    
   
841

   
842
# If the cleancount has been changed, force a make clean.
842
# If the cleancount has been changed, force a make clean.
843
# .cleancount is the global clean count, and .lastclean is the 
843
# .cleancount is the global clean count, and .lastclean is the 
844
# last clean count we had
844
# last clean count we had
845

    
   
845

   
846
cleantest:
846
cleantest:
847
	@cmp -s .cleancount .lastclean || $(MAKE) clean
847
	@cmp -s .cleancount .lastclean || $(MAKE) clean
848

    
   
848

   
849
$(SUBDIRS_UNINSTALL):
849
$(SUBDIRS_UNINSTALL):
850
	@$(SUBMAKE) -C $(@:-uninstall=) uninstall
850
	@$(SUBMAKE) -C $(@:-uninstall=) uninstall
851

    
   
851

   
852
_uninstall: $(SUBDIRS_UNINSTALL)
852
_uninstall: $(SUBDIRS_UNINSTALL)
853
	rm -f $(DESTDIR)$(MODULES_DIR)/*
853
	rm -f $(DESTDIR)$(MODULES_DIR)/*
854
	rm -f $(DESTDIR)$(ASTSBINDIR)/*asterisk*
854
	rm -f $(DESTDIR)$(ASTSBINDIR)/*asterisk*
855
	rm -f $(DESTDIR)$(ASTSBINDIR)/astgenkey
855
	rm -f $(DESTDIR)$(ASTSBINDIR)/astgenkey
856
	rm -f $(DESTDIR)$(ASTSBINDIR)/autosupport
856
	rm -f $(DESTDIR)$(ASTSBINDIR)/autosupport
857
	rm -rf $(DESTDIR)$(ASTHEADERDIR)
857
	rm -rf $(DESTDIR)$(ASTHEADERDIR)
858
	rm -rf $(DESTDIR)$(ASTDATADIR)/firmware
858
	rm -rf $(DESTDIR)$(ASTDATADIR)/firmware
859
	rm -f $(DESTDIR)$(ASTMANDIR)/man8/asterisk.8
859
	rm -f $(DESTDIR)$(ASTMANDIR)/man8/asterisk.8
860
	rm -f $(DESTDIR)$(ASTMANDIR)/man8/astgenkey.8
860
	rm -f $(DESTDIR)$(ASTMANDIR)/man8/astgenkey.8
861
	rm -f $(DESTDIR)$(ASTMANDIR)/man8/autosupport.8
861
	rm -f $(DESTDIR)$(ASTMANDIR)/man8/autosupport.8
862
	rm -f $(DESTDIR)$(ASTMANDIR)/man8/safe_asterisk.8
862
	rm -f $(DESTDIR)$(ASTMANDIR)/man8/safe_asterisk.8
863
	$(MAKE) -C sounds uninstall
863
	$(MAKE) -C sounds uninstall
864

    
   
864

   
865
uninstall: _uninstall
865
uninstall: _uninstall
866
	@echo " +--------- Asterisk Uninstall Complete -----+"  
866
	@echo " +--------- Asterisk Uninstall Complete -----+"  
867
	@echo " + Asterisk binaries, sounds, man pages,     +"  
867
	@echo " + Asterisk binaries, sounds, man pages,     +"  
868
	@echo " + headers, modules, and firmware builds,    +"  
868
	@echo " + headers, modules, and firmware builds,    +"  
869
	@echo " + have all been uninstalled.                +"  
869
	@echo " + have all been uninstalled.                +"  
870
	@echo " +                                           +"
870
	@echo " +                                           +"
871
	@echo " + To remove ALL traces of Asterisk,         +"
871
	@echo " + To remove ALL traces of Asterisk,         +"
872
	@echo " + including configuration, spool            +"
872
	@echo " + including configuration, spool            +"
873
	@echo " + directories, and logs, run the following  +"
873
	@echo " + directories, and logs, run the following  +"
874
	@echo " + command:                                  +"
874
	@echo " + command:                                  +"
875
	@echo " +                                           +"
875
	@echo " +                                           +"
876
	@echo " +            $(mK) uninstall-all            +"  
876
	@echo " +            $(mK) uninstall-all            +"  
877
	@echo " +-------------------------------------------+"  
877
	@echo " +-------------------------------------------+"  
878

    
   
878

   
879
uninstall-all: _uninstall
879
uninstall-all: _uninstall
880
	rm -rf $(DESTDIR)$(ASTLIBDIR)
880
	rm -rf $(DESTDIR)$(ASTLIBDIR)
881
	rm -rf $(DESTDIR)$(ASTVARLIBDIR)
881
	rm -rf $(DESTDIR)$(ASTVARLIBDIR)
882
	rm -rf $(DESTDIR)$(ASTDATADIR)
882
	rm -rf $(DESTDIR)$(ASTDATADIR)
883
	rm -rf $(DESTDIR)$(ASTSPOOLDIR)
883
	rm -rf $(DESTDIR)$(ASTSPOOLDIR)
884
	rm -rf $(DESTDIR)$(ASTETCDIR)
884
	rm -rf $(DESTDIR)$(ASTETCDIR)
885
	rm -rf $(DESTDIR)$(ASTLOGDIR)
885
	rm -rf $(DESTDIR)$(ASTLOGDIR)
886

    
   
886

   
887
menuconfig: menuselect
887
menuconfig: menuselect
888

    
   
888

   
889
cmenuconfig: cmenuselect
889
cmenuconfig: cmenuselect
890

    
   
890

   
891
gmenuconfig: gmenuselect
891
gmenuconfig: gmenuselect
892

    
   
892

   
893
nmenuconfig: nmenuselect
893
nmenuconfig: nmenuselect
894

    
   
894

   
895
menuselect: menuselect/cmenuselect menuselect/nmenuselect menuselect/gmenuselect
895
menuselect: menuselect/cmenuselect menuselect/nmenuselect menuselect/gmenuselect
896
	@if [ -x menuselect/nmenuselect ]; then \
896
	@if [ -x menuselect/nmenuselect ]; then \
897
		$(MAKE) nmenuselect; \
897
		$(MAKE) nmenuselect; \
898
	elif [ -x menuselect/cmenuselect ]; then \
898
	elif [ -x menuselect/cmenuselect ]; then \
899
		$(MAKE) cmenuselect; \
899
		$(MAKE) cmenuselect; \
900
	elif [ -x menuselect/gmenuselect ]; then \
900
	elif [ -x menuselect/gmenuselect ]; then \
901
		$(MAKE) gmenuselect; \
901
		$(MAKE) gmenuselect; \
902
	else \
902
	else \
903
		echo "No menuselect user interface found. Install ncurses,"; \
903
		echo "No menuselect user interface found. Install ncurses,"; \
904
		echo "newt or GTK libraries to build one and re-rerun"; \
904
		echo "newt or GTK libraries to build one and re-rerun"; \
905
		echo "'make menuselect'."; \
905
		echo "'make menuselect'."; \
906
	fi
906
	fi
907

    
   
907

   
908
cmenuselect: menuselect/cmenuselect menuselect-tree
908
cmenuselect: menuselect/cmenuselect menuselect-tree
909
	-@menuselect/cmenuselect menuselect.makeopts $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
909
	-@menuselect/cmenuselect menuselect.makeopts $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
910

    
   
910

   
911
gmenuselect: menuselect/gmenuselect menuselect-tree
911
gmenuselect: menuselect/gmenuselect menuselect-tree
912
	-@menuselect/gmenuselect menuselect.makeopts $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
912
	-@menuselect/gmenuselect menuselect.makeopts $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
913

    
   
913

   
914
nmenuselect: menuselect/nmenuselect menuselect-tree
914
nmenuselect: menuselect/nmenuselect menuselect-tree
915
	-@menuselect/nmenuselect menuselect.makeopts $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
915
	-@menuselect/nmenuselect menuselect.makeopts $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
916

    
   
916

   
917
# options for make in menuselect/
917
# options for make in menuselect/
918
MAKE_MENUSELECT=CC="$(HOST_CC)" CXX="$(CXX)" LD="" AR="" RANLIB="" CFLAGS="" $(MAKE) -C menuselect CONFIGURE_SILENT="--silent"
918
MAKE_MENUSELECT=CC="$(HOST_CC)" CXX="$(CXX)" LD="" AR="" RANLIB="" CFLAGS="" $(MAKE) -C menuselect CONFIGURE_SILENT="--silent"
919

    
   
919

   
920
menuselect/menuselect: menuselect/makeopts
920
menuselect/menuselect: menuselect/makeopts
921
	$(MAKE_MENUSELECT) menuselect
921
	$(MAKE_MENUSELECT) menuselect
922

    
   
922

   
923
menuselect/cmenuselect: menuselect/makeopts
923
menuselect/cmenuselect: menuselect/makeopts
924
	$(MAKE_MENUSELECT) cmenuselect
924
	$(MAKE_MENUSELECT) cmenuselect
925

    
   
925

   
926
menuselect/gmenuselect: menuselect/makeopts
926
menuselect/gmenuselect: menuselect/makeopts
927
	$(MAKE_MENUSELECT) gmenuselect
927
	$(MAKE_MENUSELECT) gmenuselect
928

    
   
928

   
929
menuselect/nmenuselect: menuselect/makeopts
929
menuselect/nmenuselect: menuselect/makeopts
930
	$(MAKE_MENUSELECT) nmenuselect
930
	$(MAKE_MENUSELECT) nmenuselect
931

    
   
931

   
932
menuselect/makeopts: makeopts
932
menuselect/makeopts: makeopts
933
	$(MAKE_MENUSELECT) makeopts
933
	$(MAKE_MENUSELECT) makeopts
934

    
   
934

   
935
menuselect-tree: $(foreach dir,$(filter-out main,$(MOD_SUBDIRS)),$(wildcard $(dir)/*.c) $(wildcard $(dir)/*.cc)) build_tools/cflags.xml build_tools/cflags-devmode.xml sounds/sounds.xml build_tools/embed_modules.xml configure
935
menuselect-tree: $(foreach dir,$(filter-out main,$(MOD_SUBDIRS)),$(wildcard $(dir)/*.c) $(wildcard $(dir)/*.cc)) build_tools/cflags.xml build_tools/cflags-devmode.xml sounds/sounds.xml build_tools/embed_modules.xml configure
936
	@echo "Generating input for menuselect ..."
936
	@echo "Generating input for menuselect ..."
937
	@echo "<?xml version=\"1.0\"?>" > $@
937
	@echo "<?xml version=\"1.0\"?>" > $@
938
	@echo >> $@
938
	@echo >> $@
939
	@echo "<menu name=\"Asterisk Module and Build Option Selection\">" >> $@
939
	@echo "<menu name=\"Asterisk Module and Build Option Selection\">" >> $@
940
	@for dir in $(sort $(filter-out main,$(MOD_SUBDIRS))); do $(SILENTMAKE) -C $${dir} SUBDIR=$${dir} moduleinfo >> $@; done
940
	@for dir in $(sort $(filter-out main,$(MOD_SUBDIRS))); do $(SILENTMAKE) -C $${dir} SUBDIR=$${dir} moduleinfo >> $@; done
941
	@cat build_tools/cflags.xml >> $@
941
	@cat build_tools/cflags.xml >> $@
942
	@for dir in $(sort $(filter-out main,$(MOD_SUBDIRS))); do $(SILENTMAKE) -C $${dir} SUBDIR=$${dir} makeopts >> $@; done
942
	@for dir in $(sort $(filter-out main,$(MOD_SUBDIRS))); do $(SILENTMAKE) -C $${dir} SUBDIR=$${dir} makeopts >> $@; done
943
	@if [ "${AST_DEVMODE}" = "yes" ]; then \
943
	@if [ "${AST_DEVMODE}" = "yes" ]; then \
944
		cat build_tools/cflags-devmode.xml >> $@; \
944
		cat build_tools/cflags-devmode.xml >> $@; \
945
	fi
945
	fi
946
	@cat build_tools/embed_modules.xml >> $@
946
	@cat build_tools/embed_modules.xml >> $@
947
	@cat sounds/sounds.xml >> $@
947
	@cat sounds/sounds.xml >> $@
948
	@echo "</menu>" >> $@
948
	@echo "</menu>" >> $@
949

    
   
949

   
950
pdf: asterisk.pdf
950
pdf: asterisk.pdf
951
asterisk.pdf:
951
asterisk.pdf:
952
	$(MAKE) -C doc/tex asterisk.pdf
952
	$(MAKE) -C doc/tex asterisk.pdf
953

    
   
953

   
954
.PHONY: menuselect menuselect.makeopts main sounds clean dist-clean distclean all prereqs cleantest uninstall _uninstall uninstall-all pdf dont-optimize $(SUBDIRS_INSTALL) $(SUBDIRS_DIST_CLEAN) $(SUBDIRS_CLEAN) $(SUBDIRS_UNINSTALL) $(SUBDIRS) $(MOD_SUBDIRS_EMBED_LDSCRIPT) $(MOD_SUBDIRS_EMBED_LDFLAGS) $(MOD_SUBDIRS_EMBED_LIBS) badshell installdirs validate-docs _clean
954
.PHONY: menuselect menuselect.makeopts main sounds clean dist-clean distclean all prereqs cleantest uninstall _uninstall uninstall-all pdf dont-optimize $(SUBDIRS_INSTALL) $(SUBDIRS_DIST_CLEAN) $(SUBDIRS_CLEAN) $(SUBDIRS_UNINSTALL) $(SUBDIRS) $(MOD_SUBDIRS_EMBED_LDSCRIPT) $(MOD_SUBDIRS_EMBED_LDFLAGS) $(MOD_SUBDIRS_EMBED_LIBS) badshell installdirs validate-docs _clean
955

    
   
955

   
956
FORCE:
956
FORCE:
957

    
   
957

   
/trunk/apps/app_confbridge.c
New File
 
/trunk/bridges/Makefile
New File
 
/trunk/bridges/bridge_builtin_features.c
New File
 
/trunk/bridges/bridge_multiplexed.c
New File
 
/trunk/bridges/bridge_simple.c
New File
 
/trunk/bridges/bridge_softmix.c
New File
 
/trunk/channels/chan_bridge.c
New File
 
/trunk/include/asterisk/bridging.h
New File
 
/trunk/include/asterisk/bridging_features.h
New File
 
/trunk/include/asterisk/bridging_technology.h
New File
 
/trunk/include/asterisk/channel.h
Revision 179359 New Change
 
/trunk/main/Makefile
Revision 179359 New Change
 
/trunk/main/bridging.c
New File
 
  1. /trunk/Makefile: Loading...
  2. /trunk/apps/app_confbridge.c: Loading...
  3. /trunk/bridges/Makefile: Loading...
  4. /trunk/bridges/bridge_builtin_features.c: Loading...
  5. /trunk/bridges/bridge_multiplexed.c: Loading...
  6. /trunk/bridges/bridge_simple.c: Loading...
  7. /trunk/bridges/bridge_softmix.c: Loading...
  8. /trunk/channels/chan_bridge.c: Loading...
  9. /trunk/include/asterisk/bridging.h: Loading...
  10. /trunk/include/asterisk/bridging_features.h: Loading...
  11. /trunk/include/asterisk/bridging_technology.h: Loading...
  12. /trunk/include/asterisk/channel.h: Loading...
  13. /trunk/main/Makefile: Loading...
  14. /trunk/main/bridging.c: Loading...

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.