1999-12-05 07:16:40 +00:00
|
|
|
#
|
|
|
|
# Asterisk -- A telephony toolkit for Linux.
|
|
|
|
#
|
|
|
|
# Top level Makefile
|
|
|
|
#
|
1999-12-16 22:47:49 +00:00
|
|
|
# Copyright (C) 1999, Mark Spencer
|
1999-12-05 07:16:40 +00:00
|
|
|
#
|
|
|
|
# Mark Spencer <markster@linux-support.net>
|
|
|
|
#
|
|
|
|
# This program is free software, distributed under the terms of
|
|
|
|
# the GNU General Public License
|
|
|
|
#
|
|
|
|
|
|
|
|
.EXPORT_ALL_VARIABLES:
|
|
|
|
|
2003-08-05 01:25:43 +00:00
|
|
|
# Create OPTIONS variable
|
|
|
|
OPTIONS=
|
2005-03-27 22:39:17 +00:00
|
|
|
# If cross compiling, define these to suit
|
|
|
|
# CROSS_COMPILE=/opt/montavista/pro/devkit/arm/xscale_be/bin/xscale_be-
|
|
|
|
# CROSS_COMPILE_BIN=/opt/montavista/pro/devkit/arm/xscale_be/bin/
|
|
|
|
# CROSS_COMPILE_TARGET=/opt/montavista/pro/devkit/arm/xscale_be/target
|
2005-03-30 06:31:42 +00:00
|
|
|
CC=$(CROSS_COMPILE)gcc
|
2005-03-27 22:39:17 +00:00
|
|
|
# CROSS_ARCH=Linux
|
|
|
|
# CROSS_PROC=arm
|
|
|
|
# SUB_PROC=xscale # or maverick
|
|
|
|
|
|
|
|
ifeq ($(CROSS_COMPILE),)
|
2003-04-27 18:13:11 +00:00
|
|
|
OSARCH=$(shell uname -s)
|
2005-03-27 22:39:17 +00:00
|
|
|
else
|
|
|
|
OSARCH=$(CROSS_ARCH)
|
|
|
|
endif
|
2003-04-27 18:13:11 +00:00
|
|
|
|
2003-07-28 14:43:07 +00:00
|
|
|
ifeq (${OSARCH},Linux)
|
2005-03-27 22:39:17 +00:00
|
|
|
ifeq ($(CROSS_COMPILE),)
|
2003-07-28 14:43:07 +00:00
|
|
|
PROC=$(shell uname -m)
|
2005-03-27 22:39:17 +00:00
|
|
|
else
|
|
|
|
PROC=$(CROSS_PROC)
|
|
|
|
endif
|
2004-06-13 21:25:10 +00:00
|
|
|
ifeq ($(PROC),x86_64)
|
|
|
|
# You must have GCC 3.4 to use k8, otherwise use athlon
|
|
|
|
PROC=k8
|
|
|
|
#PROC=athlon
|
|
|
|
OPTIONS+=-m64
|
|
|
|
endif
|
2004-08-31 03:31:59 +00:00
|
|
|
ifeq ($(PROC),sparc64)
|
2004-08-31 16:33:00 +00:00
|
|
|
#The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
|
|
|
|
#This works for even old (2.96) versions of gcc and provides a small boost either way.
|
|
|
|
#A ultrasparc cpu is really v9 but the stock debian stable 3.0 gcc doesn't support it.
|
|
|
|
#So we go lowest common available by gcc and go a step down, still a step up from
|
|
|
|
#the default as we now have a better instruction set to work with. - Belgarath
|
2004-08-31 03:31:59 +00:00
|
|
|
PROC=ultrasparc
|
2004-08-31 16:33:00 +00:00
|
|
|
OPTIONS+=$(shell if $(CC) -mtune=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mtune=$(PROC)"; fi)
|
|
|
|
OPTIONS+=$(shell if $(CC) -mcpu=v8 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mcpu=v8"; fi)
|
|
|
|
OPTIONS+=-fomit-frame-pointer
|
2004-08-31 03:31:59 +00:00
|
|
|
endif
|
|
|
|
|
2005-03-27 22:39:17 +00:00
|
|
|
ifeq ($(PROC),arm)
|
|
|
|
# The Cirrus logic is the only heavily shipping arm processor with a real floating point unit
|
|
|
|
ifeq ($(SUB_PROC),maverick)
|
|
|
|
OPTIONS+=-fsigned-char -mcpu=ep9312
|
|
|
|
else
|
|
|
|
ifeq ($(SUB_PROC),xscale)
|
|
|
|
OPTIONS+=-fsigned-char -msoft-float -mcpu=xscale
|
|
|
|
else
|
|
|
|
OPTIONS+=-fsigned-char -msoft-float
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
2005-01-20 16:22:59 +00:00
|
|
|
MPG123TARG=linux
|
2003-11-14 00:28:11 +00:00
|
|
|
endif
|
2004-06-22 17:42:14 +00:00
|
|
|
|
|
|
|
ifeq ($(findstring BSD,${OSARCH}),BSD)
|
|
|
|
PROC=$(shell uname -m)
|
2003-07-28 14:43:07 +00:00
|
|
|
endif
|
2004-06-22 17:42:14 +00:00
|
|
|
|
2003-03-18 06:00:18 +00:00
|
|
|
# Pentium Pro Optimize
|
2003-07-28 14:43:07 +00:00
|
|
|
#PROC=i686
|
|
|
|
|
|
|
|
# Pentium & VIA processors optimize
|
2003-03-18 06:00:18 +00:00
|
|
|
#PROC=i586
|
2003-07-28 14:43:07 +00:00
|
|
|
|
2003-03-18 06:00:18 +00:00
|
|
|
#PROC=k6
|
|
|
|
#PROC=ppc
|
2003-07-28 14:43:07 +00:00
|
|
|
|
2003-04-28 19:58:43 +00:00
|
|
|
PWD=$(shell pwd)
|
2003-03-18 06:00:18 +00:00
|
|
|
|
2004-12-14 23:36:30 +00:00
|
|
|
GREP=grep
|
|
|
|
ifeq (${OSARCH},SunOS)
|
|
|
|
GREP=/usr/xpg4/bin/grep
|
|
|
|
M4=/usr/local/bin/m4
|
|
|
|
endif
|
|
|
|
|
2003-03-18 06:00:18 +00:00
|
|
|
######### More GSM codec optimization
|
|
|
|
######### Uncomment to enable MMXTM optimizations for x86 architecture CPU's
|
|
|
|
######### which support MMX instructions. This should be newer pentiums,
|
|
|
|
######### ppro's, etc, as well as the AMD K6 and K7.
|
2003-04-28 23:04:57 +00:00
|
|
|
#K6OPT = -DK6OPT
|
2003-03-18 06:00:18 +00:00
|
|
|
|
2004-11-19 14:04:57 +00:00
|
|
|
#Overwite config files on "make samples"
|
|
|
|
OVERWRITE=y
|
|
|
|
|
2003-03-18 06:00:18 +00:00
|
|
|
#Tell gcc to optimize the asterisk's code
|
2004-08-31 16:33:00 +00:00
|
|
|
OPTIMIZE+=-O6
|
2003-03-18 06:00:18 +00:00
|
|
|
|
|
|
|
#Include debug symbols in the executables (-g) and profiling info (-pg)
|
|
|
|
DEBUG=-g #-pg
|
|
|
|
|
2004-05-31 16:04:10 +00:00
|
|
|
# If you are running a radio application, define RADIO_RELAX so that the DTMF
|
|
|
|
# will be received more reliably
|
|
|
|
#OPTIONS += -DRADIO_RELAX
|
|
|
|
|
2005-03-27 22:39:17 +00:00
|
|
|
# If you don't have a lot of memory (e.g. embedded Asterisk), define LOW_MEMORY
|
|
|
|
# to reduce the size of certain static buffers
|
|
|
|
|
2005-03-27 22:39:51 +00:00
|
|
|
#ifneq ($(CROSS_COMPILE),)
|
|
|
|
#OPTIONS += -DLOW_MEMORY
|
|
|
|
#endif
|
2004-06-12 14:34:15 +00:00
|
|
|
|
2003-03-18 06:00:18 +00:00
|
|
|
# Optional debugging parameters
|
2005-02-08 18:48:01 +00:00
|
|
|
DEBUG_THREADS = #-DDEBUG_THREADS #-DDO_CRASH #-DDETECT_DEADLOCKS
|
2003-03-18 06:00:18 +00:00
|
|
|
|
|
|
|
# Uncomment next one to enable ast_frame tracing (for debugging)
|
|
|
|
TRACE_FRAMES = #-DTRACE_FRAMES
|
|
|
|
|
2003-04-28 19:58:43 +00:00
|
|
|
# Uncomment next one to enable malloc debugging
|
|
|
|
# You can view malloc debugging with:
|
|
|
|
# *CLI> show memory allocations [filename]
|
|
|
|
# *CLI> show memory summary [filename]
|
|
|
|
#
|
2003-05-06 14:49:34 +00:00
|
|
|
MALLOC_DEBUG = #-include $(PWD)/include/asterisk/astmm.h
|
2003-04-28 19:58:43 +00:00
|
|
|
|
2003-03-18 06:00:18 +00:00
|
|
|
# Where to install asterisk after compiling
|
|
|
|
# Default -> leave empty
|
2001-09-24 21:29:03 +00:00
|
|
|
INSTALL_PREFIX=
|
|
|
|
|
2003-10-25 17:27:53 +00:00
|
|
|
# Staging directory
|
|
|
|
# Files are copied here temporarily during the install process
|
|
|
|
# For example, make DESTDIR=/tmp/asterisk woud put things in
|
|
|
|
# /tmp/asterisk/etc/asterisk
|
|
|
|
DESTDIR=
|
|
|
|
|
2003-06-17 21:53:18 +00:00
|
|
|
# Original busydetect routine
|
2003-08-14 15:58:22 +00:00
|
|
|
BUSYDETECT = #-DBUSYDETECT
|
2003-06-17 21:53:18 +00:00
|
|
|
|
2003-06-17 22:30:25 +00:00
|
|
|
# Improved busydetect routine, comment the previous one if you use this one
|
2003-08-14 15:58:22 +00:00
|
|
|
BUSYDETECT+= -DBUSYDETECT_MARTIN
|
2003-06-17 21:53:18 +00:00
|
|
|
# Detect the busy signal looking only at tone lengths
|
|
|
|
# For example if you have 3 beeps 100ms tone, 100ms silence separated by 500 ms of silence
|
|
|
|
BUSYDETECT+= #-DBUSYDETECT_TONEONLY
|
|
|
|
# Inforce the detection of busy singal (get rid of false hangups)
|
|
|
|
# Don't use together with -DBUSYDETECT_TONEONLY
|
|
|
|
BUSYDETECT+= #-DBUSYDETECT_COMPARE_TONE_AND_SILENCE
|
|
|
|
|
2003-02-04 16:35:12 +00:00
|
|
|
ASTLIBDIR=$(INSTALL_PREFIX)/usr/lib/asterisk
|
|
|
|
ASTVARLIBDIR=$(INSTALL_PREFIX)/var/lib/asterisk
|
|
|
|
ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk
|
|
|
|
ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
|
|
|
|
ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
|
|
|
|
ASTHEADERDIR=$(INSTALL_PREFIX)/usr/include/asterisk
|
|
|
|
ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
|
|
|
|
ASTBINDIR=$(INSTALL_PREFIX)/usr/bin
|
|
|
|
ASTSBINDIR=$(INSTALL_PREFIX)/usr/sbin
|
|
|
|
ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
|
2004-07-18 17:58:05 +00:00
|
|
|
ASTMANDIR=$(INSTALL_PREFIX)/usr/share/man
|
2003-02-04 16:35:12 +00:00
|
|
|
|
|
|
|
MODULES_DIR=$(ASTLIBDIR)/modules
|
|
|
|
AGI_DIR=$(ASTVARLIBDIR)/agi-bin
|
1999-12-05 07:16:40 +00:00
|
|
|
|
|
|
|
INCLUDE=-Iinclude -I../include
|
2003-03-02 19:52:23 +00:00
|
|
|
CFLAGS=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
|
2003-03-18 06:00:18 +00:00
|
|
|
CFLAGS+=$(OPTIMIZE)
|
2004-08-31 03:31:59 +00:00
|
|
|
|
|
|
|
ifneq ($(PROC),ultrasparc)
|
2000-01-05 20:03:55 +00:00
|
|
|
CFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
|
2004-08-31 03:31:59 +00:00
|
|
|
endif
|
2005-03-27 22:39:17 +00:00
|
|
|
ifeq ($(PROC),ppc)
|
|
|
|
CFLAGS+=-fsigned-char
|
|
|
|
endif
|
2004-08-31 03:31:59 +00:00
|
|
|
|
2005-03-27 22:39:17 +00:00
|
|
|
CFLAGS+=$(shell if [ -f $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h ]; then echo "-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)/usr/include/osp" ; fi)
|
2004-06-22 17:42:14 +00:00
|
|
|
|
2003-10-21 02:57:29 +00:00
|
|
|
ifeq (${OSARCH},FreeBSD)
|
2005-03-27 22:39:17 +00:00
|
|
|
OSVERSION=$(shell make -V OSVERSION -f $(CROSS_COMPILE_TARGET)/usr/share/mk/bsd.port.subdir.mk)
|
2004-09-28 17:11:30 +00:00
|
|
|
CFLAGS+=$(shell if test ${OSVERSION} -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
|
|
|
|
LIBS+=$(shell if test ${OSVERSION} -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
|
2005-03-27 22:39:17 +00:00
|
|
|
INCLUDE+=-I$(CROSS_COMPILE_TARGET)/usr/local/include
|
|
|
|
CFLAGS+=$(shell if [ -d $(CROSS_COMPILE_TARGET)/usr/local/include/spandsp ]; then echo "-I$(CROSS_COMPILE_TARGET)/usr/local/include/spandsp"; fi)
|
2005-01-20 16:22:59 +00:00
|
|
|
MPG123TARG=freebsd
|
2004-06-22 17:42:14 +00:00
|
|
|
endif # FreeBSD
|
|
|
|
|
2004-08-31 13:32:11 +00:00
|
|
|
ifeq (${OSARCH},NetBSD)
|
|
|
|
CFLAGS+=-pthread
|
2005-03-27 22:39:17 +00:00
|
|
|
INCLUDE+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -I$(CROSS_COMPILE_TARGET)/usr/pkg/include
|
2005-01-20 16:22:59 +00:00
|
|
|
MPG123TARG=netbsd
|
2004-08-31 13:32:11 +00:00
|
|
|
endif
|
|
|
|
|
2003-04-27 18:13:11 +00:00
|
|
|
ifeq (${OSARCH},OpenBSD)
|
|
|
|
CFLAGS+=-pthread
|
|
|
|
endif
|
2004-12-14 23:36:30 +00:00
|
|
|
ifeq (${OSARCH},SunOS)
|
|
|
|
CFLAGS+=-Wcast-align -DSOLARIS
|
2005-03-27 22:39:17 +00:00
|
|
|
INCLUDE+=-Iinclude/solaris-compat -I$(CROSS_COMPILE_TARGET)/usr/local/ssl/include
|
2004-12-14 23:36:30 +00:00
|
|
|
endif
|
2002-06-21 01:40:13 +00:00
|
|
|
|
2004-01-13 20:17:56 +00:00
|
|
|
#Uncomment this to use the older DSP routines
|
|
|
|
#CFLAGS+=-DOLD_DSP_ROUTINES
|
2004-01-13 01:15:17 +00:00
|
|
|
|
2005-03-27 22:39:17 +00:00
|
|
|
CFLAGS+=$(shell if [ -f $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi)
|
|
|
|
CFLAGS+=$(shell if [ -f $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi)
|
2003-05-12 04:23:55 +00:00
|
|
|
|
2003-02-04 16:35:12 +00:00
|
|
|
LIBEDIT=editline/libedit.a
|
|
|
|
|
2004-04-29 22:27:40 +00:00
|
|
|
ASTERISKVERSION=$(shell if [ -f .version ]; then cat .version; else if [ -d CVS ]; then if [ -f CVS/Tag ] ; then echo "CVS-`sed 's/^T//g' CVS/Tag`-`date +"%D-%T"`"; else echo "CVS-HEAD-`date +"%D-%T"`"; fi; fi; fi)
|
2004-10-24 02:53:24 +00:00
|
|
|
ASTERISKVERSIONNUM=$(shell if [ -d CVS ]; then echo 999999 ; else if [ -f .version ] ; then awk -F. '{printf "%02d%02d%02d", $$1, $$2, $$3}' .version ; else echo 000000 ; fi ; fi)
|
2005-03-27 22:39:17 +00:00
|
|
|
HTTPDIR=$(shell if [ -d $(CROSS_COMPILE_TARGET)/var/www ]; then echo "/var/www"; else echo "/home/httpd"; fi)
|
2003-02-04 16:35:12 +00:00
|
|
|
RPMVERSION=$(shell if [ -f .version ]; then sed 's/[-\/:]/_/g' .version; else echo "unknown" ; fi)
|
2001-05-09 03:11:22 +00:00
|
|
|
CFLAGS+=-DASTERISK_VERSION=\"$(ASTERISKVERSION)\"
|
2004-10-24 13:11:15 +00:00
|
|
|
CFLAGS+=-DASTERISK_VERSION_NUM=$(ASTERISKVERSIONNUM)
|
2003-02-04 16:35:12 +00:00
|
|
|
CFLAGS+=-DINSTALL_PREFIX=\"$(INSTALL_PREFIX)\"
|
|
|
|
CFLAGS+=-DASTETCDIR=\"$(ASTETCDIR)\"
|
|
|
|
CFLAGS+=-DASTLIBDIR=\"$(ASTLIBDIR)\"
|
|
|
|
CFLAGS+=-DASTVARLIBDIR=\"$(ASTVARLIBDIR)\"
|
|
|
|
CFLAGS+=-DASTVARRUNDIR=\"$(ASTVARRUNDIR)\"
|
|
|
|
CFLAGS+=-DASTSPOOLDIR=\"$(ASTSPOOLDIR)\"
|
|
|
|
CFLAGS+=-DASTLOGDIR=\"$(ASTLOGDIR)\"
|
|
|
|
CFLAGS+=-DASTCONFPATH=\"$(ASTCONFPATH)\"
|
|
|
|
CFLAGS+=-DASTMODDIR=\"$(MODULES_DIR)\"
|
|
|
|
CFLAGS+=-DASTAGIDIR=\"$(AGI_DIR)\"
|
|
|
|
|
2003-03-18 06:00:18 +00:00
|
|
|
CFLAGS+= $(DEBUG_THREADS)
|
|
|
|
CFLAGS+= $(TRACE_FRAMES)
|
2003-04-28 19:58:43 +00:00
|
|
|
CFLAGS+= $(MALLOC_DEBUG)
|
2003-06-17 21:53:18 +00:00
|
|
|
CFLAGS+= $(BUSYDETECT)
|
2003-08-05 01:25:43 +00:00
|
|
|
CFLAGS+= $(OPTIONS)
|
2005-03-05 21:06:26 +00:00
|
|
|
CFLAGS+= -fomit-frame-pointer
|
2005-05-05 05:39:33 +00:00
|
|
|
SUBDIRS=res channels pbx apps codecs formats agi cdr funcs utils stdtime
|
2003-04-27 18:13:11 +00:00
|
|
|
ifeq (${OSARCH},Linux)
|
2003-10-21 09:18:13 +00:00
|
|
|
LIBS=-ldl -lpthread
|
2003-04-27 18:13:11 +00:00
|
|
|
endif
|
2003-10-21 02:57:29 +00:00
|
|
|
LIBS+=-lncurses -lm
|
|
|
|
ifeq (${OSARCH},Linux)
|
|
|
|
LIBS+=-lresolv #-lnjamd
|
|
|
|
endif
|
2003-10-27 20:00:41 +00:00
|
|
|
ifeq (${OSARCH},Darwin)
|
|
|
|
LIBS+=-lresolv
|
2004-12-19 17:33:19 +00:00
|
|
|
CFLAGS+=-D__OSX__
|
2003-10-27 20:00:41 +00:00
|
|
|
endif
|
2004-06-25 22:56:28 +00:00
|
|
|
ifeq (${OSARCH},FreeBSD)
|
|
|
|
LIBS+=-lcrypto
|
|
|
|
endif
|
2004-08-31 13:32:11 +00:00
|
|
|
ifeq (${OSARCH},NetBSD)
|
2005-03-27 22:39:17 +00:00
|
|
|
LIBS+=-lpthread -lcrypto -lm -L$(CROSS_COMPILE_TARGET)/usr/local/lib -L$(CROSS_COMPILE_TARGET)/usr/pkg/lib -lncurses
|
2004-08-31 13:32:11 +00:00
|
|
|
endif
|
2004-08-01 18:48:37 +00:00
|
|
|
ifeq (${OSARCH},OpenBSD)
|
|
|
|
LIBS=-lcrypto -lpthread -lm -lncurses
|
|
|
|
endif
|
2004-12-14 23:36:30 +00:00
|
|
|
ifeq (${OSARCH},SunOS)
|
2005-03-27 22:39:17 +00:00
|
|
|
LIBS+=-lpthread -ldl -lnsl -lsocket -lresolv -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib
|
2004-12-14 23:36:30 +00:00
|
|
|
endif
|
2004-06-25 04:06:11 +00:00
|
|
|
LIBS+=-lssl
|
2005-05-16 00:35:38 +00:00
|
|
|
|
|
|
|
FLEXVER_GT_2_5_31=$(shell ./vercomp.sh flex \>= 2.5.31)
|
|
|
|
BISONVER=$(shell bison --version | grep \^bison | egrep -o '[0-9]+\.[-0-9.]+[a-z]?' )
|
|
|
|
BISONVERGE_85=$(shell ./vercomp.sh bison \>= 1.85 )
|
|
|
|
|
|
|
|
ifeq (${FLEXVER_GT_2_5_31},true)
|
|
|
|
FLEXOBJS=ast_expr2.o ast_expr2f.o
|
|
|
|
else
|
|
|
|
FLEXOBJS=ast_expr.o
|
|
|
|
endif
|
|
|
|
|
2001-03-30 22:04:14 +00:00
|
|
|
OBJS=io.o sched.o logger.o frame.o loader.o config.o channel.o \
|
2002-06-21 01:40:13 +00:00
|
|
|
translate.o file.o say.o pbx.o cli.o md5.o term.o \
|
2002-01-07 02:01:04 +00:00
|
|
|
ulaw.o alaw.o callerid.o fskmodem.o image.o app.o \
|
2005-05-16 00:35:38 +00:00
|
|
|
cdr.o tdd.o acl.o rtp.o manager.o asterisk.o ${FLEXOBJS} \
|
2003-04-28 19:58:43 +00:00
|
|
|
dsp.o chanvars.o indications.o autoservice.o db.o privacy.o \
|
2004-05-09 08:22:15 +00:00
|
|
|
astmm.o enum.o srv.o dns.o aescrypt.o aestab.o aeskey.o \
|
2005-04-06 21:12:32 +00:00
|
|
|
utils.o config_old.o plc.o jitterbuf.o dnsmgr.o
|
2003-10-26 18:50:49 +00:00
|
|
|
ifeq (${OSARCH},Darwin)
|
|
|
|
OBJS+=poll.o dlfcn.o
|
|
|
|
ASTLINK=-Wl,-dynamic
|
|
|
|
SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace
|
|
|
|
else
|
|
|
|
ASTLINK=-Wl,-E
|
|
|
|
SOLINK=-shared -Xlinker -x
|
|
|
|
endif
|
2004-12-14 23:36:30 +00:00
|
|
|
ifeq (${OSARCH},SunOS)
|
|
|
|
OBJS+=strcompat.o
|
|
|
|
ASTLINK=
|
2005-03-27 22:39:17 +00:00
|
|
|
SOLINK=-shared -fpic -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib
|
2004-12-14 23:36:30 +00:00
|
|
|
endif
|
2003-10-26 18:50:49 +00:00
|
|
|
|
1999-12-05 07:16:40 +00:00
|
|
|
INSTALL=install
|
|
|
|
|
2000-01-05 20:03:55 +00:00
|
|
|
_all: all
|
|
|
|
@echo " +--------- Asterisk Build Complete ---------+"
|
|
|
|
@echo " + Asterisk has successfully been built, but +"
|
|
|
|
@echo " + cannot be run before being installed by +"
|
|
|
|
@echo " + running: +"
|
|
|
|
@echo " + +"
|
2003-04-23 16:23:12 +00:00
|
|
|
@echo " + $(MAKE) install +"
|
2000-01-05 20:03:55 +00:00
|
|
|
@echo " +-------------------------------------------+"
|
|
|
|
|
2005-01-17 04:48:51 +00:00
|
|
|
all: cleantest depend asterisk subdirs
|
|
|
|
|
2005-04-01 21:18:39 +00:00
|
|
|
ifneq ($(wildcard tags),)
|
|
|
|
all: tags
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(wildcard TAGS),)
|
|
|
|
all: TAGS
|
|
|
|
endif
|
|
|
|
|
2005-01-17 04:48:51 +00:00
|
|
|
noclean: depend asterisk subdirs
|
1999-12-05 07:16:40 +00:00
|
|
|
|
2003-02-04 16:35:12 +00:00
|
|
|
editline/config.h:
|
2003-09-13 20:51:48 +00:00
|
|
|
cd editline && unset CFLAGS LIBS && ./configure ; \
|
2003-02-04 16:35:12 +00:00
|
|
|
|
2003-09-27 15:52:17 +00:00
|
|
|
editline/libedit.a: FORCE
|
|
|
|
cd editline && unset CFLAGS LIBS && test -f config.h || ./configure
|
2003-04-23 16:23:12 +00:00
|
|
|
$(MAKE) -C editline libedit.a
|
2003-02-04 16:35:12 +00:00
|
|
|
|
2003-09-27 15:52:17 +00:00
|
|
|
db1-ast/libdb1.a: FORCE
|
2003-02-04 16:35:12 +00:00
|
|
|
@if [ -d db1-ast ]; then \
|
2003-04-23 16:23:12 +00:00
|
|
|
$(MAKE) -C db1-ast libdb1.a ; \
|
2003-02-04 16:35:12 +00:00
|
|
|
else \
|
|
|
|
echo "You need to do a cvs update -d not just cvs update"; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
|
2003-08-19 16:42:30 +00:00
|
|
|
ifneq ($(wildcard .depend),)
|
2003-05-06 00:00:20 +00:00
|
|
|
include .depend
|
2003-08-19 16:42:30 +00:00
|
|
|
endif
|
2003-05-06 00:00:20 +00:00
|
|
|
|
2005-04-01 21:18:39 +00:00
|
|
|
ifneq ($(wildcard .tags-depend),)
|
|
|
|
include .tags-depend
|
|
|
|
endif
|
|
|
|
|
2003-08-24 23:34:50 +00:00
|
|
|
.PHONY: _version
|
|
|
|
|
2001-05-09 03:11:22 +00:00
|
|
|
_version:
|
2004-12-14 23:36:30 +00:00
|
|
|
if [ -d CVS ] && [ ! -f .version ]; then echo $(ASTERISKVERSION) > .version; fi
|
2001-05-09 03:11:22 +00:00
|
|
|
|
2002-01-13 15:11:01 +00:00
|
|
|
.version: _version
|
2002-01-07 02:01:04 +00:00
|
|
|
|
2002-09-02 15:20:28 +00:00
|
|
|
.y.c:
|
2005-05-16 00:35:38 +00:00
|
|
|
@if (($(BISONVERGE_85) = false)); then \
|
|
|
|
echo ================================================================================= ;\
|
|
|
|
echo NOTE: you may have trouble if you do not have bison-1.85 or higher installed! ;\
|
|
|
|
echo NOTE: you can pick up a copy at: http://ftp.gnu.org/ or its mirrors ;\
|
|
|
|
echo NOTE: You Have: $(BISONVER) ;\
|
|
|
|
echo ================================================================================; \
|
|
|
|
else \
|
|
|
|
echo EXCELLENT-- You have Bison version $(BISONVER), this should work just fine...;\
|
|
|
|
fi
|
|
|
|
bison -v -d --name-prefix=ast_yy $< -o $@
|
2002-09-02 15:20:28 +00:00
|
|
|
|
|
|
|
ast_expr.o: ast_expr.c
|
2005-05-16 00:35:38 +00:00
|
|
|
@echo NOTE:
|
|
|
|
@echo NOTE:
|
|
|
|
@echo NOTE: Using older version of ast_expr. To use the newer version,
|
|
|
|
@echo NOTE: Upgrade to flex 2.5.31 or higher, which can be found at http://
|
|
|
|
@echo NOTE: http://sourceforge.net/project/showfiles.php?group_id=72099
|
|
|
|
@echo NOTE:
|
|
|
|
@echo NOTE:
|
|
|
|
$(CC) -c $(CPPFLAGS) $(CFLAGS) ast_expr.c
|
|
|
|
|
|
|
|
ast_expr2.o: ast_expr2.c
|
|
|
|
|
|
|
|
ast_expr2f.o: ast_expr2f.c
|
|
|
|
ast_expr2f.c: ast_expr2.fl
|
|
|
|
flex ast_expr2.fl
|
2002-09-02 15:20:28 +00:00
|
|
|
|
2003-04-23 16:23:12 +00:00
|
|
|
cli.o: cli.c build.h
|
|
|
|
|
2003-09-02 00:33:42 +00:00
|
|
|
asterisk.o: asterisk.c build.h
|
|
|
|
|
2005-05-16 00:35:38 +00:00
|
|
|
testexpr2 :
|
|
|
|
flex ast_expr2.fl
|
|
|
|
bison -v -d --name-prefix=ast_yy -o ast_expr2.c ast_expr2.y
|
|
|
|
gcc -g -c -DSTANDALONE ast_expr2f.c
|
|
|
|
gcc -g -c -DSTANDALONE ast_expr2.c
|
|
|
|
gcc -g -o testexpr2 ast_expr2f.o ast_expr2.o
|
|
|
|
rm ast_expr2.c ast_expr2.o ast_expr2f.o ast_expr2f.c
|
|
|
|
|
|
|
|
|
2004-07-18 17:58:05 +00:00
|
|
|
manpage: asterisk.8.gz
|
|
|
|
|
|
|
|
asterisk.8.gz: asterisk.sgml
|
|
|
|
rm -f asterisk.8
|
|
|
|
docbook2man asterisk.sgml
|
|
|
|
mv ./*.8 asterisk.8
|
|
|
|
gzip asterisk.8
|
|
|
|
|
2005-04-29 15:18:10 +00:00
|
|
|
asterisk.pdf: asterisk.sgml
|
|
|
|
docbook2pdf asterisk.sgml
|
|
|
|
|
|
|
|
asterisk.ps: asterisk.sgml
|
|
|
|
docbook2ps asterisk.sgml
|
|
|
|
|
|
|
|
asterisk.html: asterisk.sgml
|
|
|
|
docbook2html asterisk.sgml
|
|
|
|
mv r1.html asterisk.html
|
|
|
|
|
|
|
|
asterisk.txt: asterisk.sgml
|
|
|
|
docbook2txt asterisk.sgml
|
|
|
|
|
2003-04-23 16:23:12 +00:00
|
|
|
ifneq ($(strip $(ASTERISKVERSION)),)
|
|
|
|
build.h: .version
|
|
|
|
./make_build_h
|
|
|
|
else
|
2001-05-09 03:11:22 +00:00
|
|
|
build.h:
|
|
|
|
./make_build_h
|
2003-04-23 16:23:12 +00:00
|
|
|
endif
|
2001-05-09 03:11:22 +00:00
|
|
|
|
2003-09-27 15:52:17 +00:00
|
|
|
stdtime/libtime.a: FORCE
|
2003-09-13 20:51:48 +00:00
|
|
|
@if [ -d stdtime ]; then \
|
2003-09-27 02:32:30 +00:00
|
|
|
$(MAKE) -C stdtime libtime.a ; \
|
2003-09-13 20:51:48 +00:00
|
|
|
else \
|
|
|
|
echo "You need to do a cvs update -d not just cvs update"; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
|
2003-09-27 02:32:30 +00:00
|
|
|
asterisk: editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
|
2004-05-20 07:08:31 +00:00
|
|
|
$(CC) $(DEBUG) -o asterisk $(ASTLINK) $(OBJS) $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a $(LIBS)
|
1999-12-05 07:16:40 +00:00
|
|
|
|
2004-05-17 06:31:24 +00:00
|
|
|
muted: muted.o
|
|
|
|
$(CC) -o muted muted.o
|
|
|
|
|
1999-12-05 07:16:40 +00:00
|
|
|
subdirs:
|
|
|
|
for x in $(SUBDIRS); do $(MAKE) -C $$x || exit 1 ; done
|
|
|
|
|
|
|
|
clean:
|
|
|
|
for x in $(SUBDIRS); do $(MAKE) -C $$x clean || exit 1 ; done
|
2003-05-06 00:00:20 +00:00
|
|
|
rm -f *.o *.so asterisk .depend
|
2002-09-02 15:20:28 +00:00
|
|
|
rm -f build.h
|
|
|
|
rm -f ast_expr.c
|
2005-01-17 04:48:51 +00:00
|
|
|
rm -f .version
|
2005-04-01 21:18:39 +00:00
|
|
|
rm -f .tags-depend .tags-sources tags TAGS
|
2004-12-14 23:36:30 +00:00
|
|
|
@if [ -f editline/Makefile ]; then $(MAKE) -C editline distclean ; fi
|
2005-01-20 16:22:59 +00:00
|
|
|
@if [ -d mpg123-0.59r ]; then $(MAKE) -C mpg123-0.59r clean; fi
|
2003-04-23 16:23:12 +00:00
|
|
|
$(MAKE) -C db1-ast clean
|
2003-09-13 20:51:48 +00:00
|
|
|
$(MAKE) -C stdtime clean
|
1999-12-05 07:16:40 +00:00
|
|
|
|
2000-01-05 20:03:55 +00:00
|
|
|
datafiles: all
|
2004-11-11 20:57:49 +00:00
|
|
|
sh mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig
|
2003-10-25 17:27:53 +00:00
|
|
|
mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits
|
2003-02-04 16:35:12 +00:00
|
|
|
for x in sounds/digits/*.gsm; do \
|
2004-12-14 23:36:30 +00:00
|
|
|
if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
|
2004-01-14 06:48:38 +00:00
|
|
|
install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
|
2003-02-04 16:35:12 +00:00
|
|
|
else \
|
|
|
|
echo "No description for $$x"; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
2000-01-05 20:03:55 +00:00
|
|
|
done
|
2005-05-04 19:33:33 +00:00
|
|
|
mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate
|
|
|
|
for x in sounds/dictate/*.gsm; do \
|
|
|
|
if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
|
|
|
|
install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate ; \
|
|
|
|
else \
|
|
|
|
echo "No description for $$x"; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
done
|
2004-05-03 00:54:16 +00:00
|
|
|
mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters
|
|
|
|
for x in sounds/letters/*.gsm; do \
|
2004-12-14 23:36:30 +00:00
|
|
|
if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
|
2004-05-03 00:54:16 +00:00
|
|
|
install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \
|
|
|
|
else \
|
|
|
|
echo "No description for $$x"; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic
|
|
|
|
for x in sounds/phonetic/*.gsm; do \
|
2004-12-14 23:36:30 +00:00
|
|
|
if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
|
2004-05-03 00:54:16 +00:00
|
|
|
install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \
|
|
|
|
else \
|
|
|
|
echo "No description for $$x"; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
done
|
2004-03-13 06:00:41 +00:00
|
|
|
for x in sounds/vm-* sounds/transfer* sounds/pbx-* sounds/ss-* sounds/beep* sounds/dir-* sounds/conf-* sounds/agent-* sounds/invalid* sounds/tt-* sounds/auth-* sounds/privacy-* sounds/queue-*; do \
|
2004-12-14 23:36:30 +00:00
|
|
|
if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
|
2004-01-14 06:48:38 +00:00
|
|
|
install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
|
2003-02-04 16:35:12 +00:00
|
|
|
else \
|
|
|
|
echo "No description for $$x"; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
2000-01-05 20:03:55 +00:00
|
|
|
done
|
2003-10-25 17:27:53 +00:00
|
|
|
mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/mohmp3
|
|
|
|
mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/images
|
2001-09-24 21:29:03 +00:00
|
|
|
for x in images/*.jpg; do \
|
2004-01-14 06:48:38 +00:00
|
|
|
install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \
|
2001-09-24 21:29:03 +00:00
|
|
|
done
|
2003-10-25 17:27:53 +00:00
|
|
|
mkdir -p $(DESTDIR)$(AGI_DIR)
|
2001-09-24 21:29:03 +00:00
|
|
|
|
2003-02-04 16:35:12 +00:00
|
|
|
update:
|
|
|
|
@if [ -d CVS ]; then \
|
2005-03-11 08:24:23 +00:00
|
|
|
if [ -f patches/.applied ]; then \
|
|
|
|
patches=`cat patches/.applied`; \
|
|
|
|
fi; \
|
|
|
|
if ! [ -z "$$patches" ]; then \
|
|
|
|
for x in $$patches; do \
|
|
|
|
echo "Unapplying $$x..."; \
|
|
|
|
patch -R -p0 < patches/$$x; \
|
|
|
|
done; \
|
|
|
|
rm -f patches/.applied; \
|
|
|
|
fi ; \
|
2003-02-04 16:35:12 +00:00
|
|
|
echo "Updating from CVS..." ; \
|
2004-12-29 23:52:42 +00:00
|
|
|
cvs -q -z3 update -Pd | tee update.out; \
|
2003-02-04 16:35:12 +00:00
|
|
|
rm -f .version; \
|
2004-12-29 23:52:42 +00:00
|
|
|
if [ `grep -c ^C update.out` -gt 0 ]; then \
|
|
|
|
echo ; echo "The following files have conflicts:" ; \
|
|
|
|
grep ^C update.out | cut -d' ' -f2- ; \
|
|
|
|
fi ; \
|
|
|
|
rm -f update.out; \
|
2005-03-11 08:24:23 +00:00
|
|
|
if ! [ -z "$$patches" ]; then \
|
|
|
|
for x in $$patches; do \
|
|
|
|
if [ -f patches/$$x ]; then \
|
|
|
|
echo "Applying patch $$x..."; \
|
|
|
|
patch -p0 < patches/$$x; \
|
|
|
|
echo $$x >> patches/.applied; \
|
|
|
|
else \
|
|
|
|
echo "Patch $$x no longer relevant"; \
|
|
|
|
fi; \
|
|
|
|
done; \
|
|
|
|
fi; \
|
2003-02-04 16:35:12 +00:00
|
|
|
else \
|
|
|
|
echo "Not CVS"; \
|
|
|
|
fi
|
|
|
|
|
2005-04-27 16:27:53 +00:00
|
|
|
NEWHEADERS=$(notdir $(wildcard include/asterisk/*.h))
|
|
|
|
OLDHEADERS=$(filter-out $(NEWHEADERS),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h)))
|
|
|
|
|
2003-02-04 16:35:12 +00:00
|
|
|
bininstall: all
|
2003-10-25 17:27:53 +00:00
|
|
|
mkdir -p $(DESTDIR)$(MODULES_DIR)
|
|
|
|
mkdir -p $(DESTDIR)$(ASTSBINDIR)
|
|
|
|
mkdir -p $(DESTDIR)$(ASTETCDIR)
|
|
|
|
mkdir -p $(DESTDIR)$(ASTBINDIR)
|
|
|
|
mkdir -p $(DESTDIR)$(ASTSBINDIR)
|
|
|
|
mkdir -p $(DESTDIR)$(ASTVARRUNDIR)
|
|
|
|
mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail
|
2005-05-04 19:33:33 +00:00
|
|
|
mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/dictate
|
2005-02-27 19:07:46 +00:00
|
|
|
mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/system
|
2004-09-07 01:49:08 +00:00
|
|
|
mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/tmp
|
2005-03-12 05:37:32 +00:00
|
|
|
mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/meetme
|
2003-10-25 17:27:53 +00:00
|
|
|
install -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/
|
2004-01-12 03:15:34 +00:00
|
|
|
install -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
|
2005-01-21 04:44:49 +00:00
|
|
|
install -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
|
2004-01-12 03:19:25 +00:00
|
|
|
if [ ! -f $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ]; then \
|
|
|
|
install -m 755 contrib/scripts/safe_asterisk $(DESTDIR)$(ASTSBINDIR)/ ;\
|
2004-01-12 03:15:34 +00:00
|
|
|
fi
|
1999-12-05 07:16:40 +00:00
|
|
|
for x in $(SUBDIRS); do $(MAKE) -C $$x install || exit 1 ; done
|
2003-10-25 17:27:53 +00:00
|
|
|
install -d $(DESTDIR)$(ASTHEADERDIR)
|
2004-01-14 06:48:38 +00:00
|
|
|
install -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
|
2005-04-27 05:46:32 +00:00
|
|
|
if [ -n "$(OLDHEADERS)" ]; then \
|
|
|
|
rm -f $(addprefix $(DESTDIR)$(ASTHEADERDIR)/,$(OLDHEADERS)) ;\
|
|
|
|
fi
|
2003-10-25 17:27:53 +00:00
|
|
|
rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/voicemail
|
|
|
|
mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds
|
|
|
|
mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
|
2005-03-28 20:48:24 +00:00
|
|
|
mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-custom
|
2003-10-25 17:27:53 +00:00
|
|
|
mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/keys
|
2004-02-24 21:27:16 +00:00
|
|
|
mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware
|
|
|
|
mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax
|
2004-07-19 15:52:57 +00:00
|
|
|
mkdir -p $(DESTDIR)$(ASTMANDIR)/man8
|
2003-10-25 17:27:53 +00:00
|
|
|
install -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
|
2004-06-02 23:19:36 +00:00
|
|
|
install -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
|
2004-07-18 17:58:05 +00:00
|
|
|
install -m 644 asterisk.8.gz $(DESTDIR)$(ASTMANDIR)/man8
|
2004-03-04 22:09:48 +00:00
|
|
|
if [ -d contrib/firmware/iax ]; then \
|
2004-03-23 17:00:13 +00:00
|
|
|
install -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \
|
2004-03-04 22:09:48 +00:00
|
|
|
else \
|
|
|
|
echo "You need to do cvs update -d not just cvs update" ; \
|
|
|
|
fi
|
2003-10-25 17:27:53 +00:00
|
|
|
( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/voicemail . )
|
2005-01-20 16:22:59 +00:00
|
|
|
if [ -f mpg123-0.59r/mpg123 ]; then $(MAKE) -C mpg123-0.59r install; fi
|
2000-01-05 20:03:55 +00:00
|
|
|
@echo " +---- Asterisk Installation Complete -------+"
|
2001-09-24 21:29:03 +00:00
|
|
|
@echo " + +"
|
|
|
|
@echo " + YOU MUST READ THE SECURITY DOCUMENT +"
|
|
|
|
@echo " + +"
|
2000-01-05 20:03:55 +00:00
|
|
|
@echo " + Asterisk has successfully been installed. +"
|
|
|
|
@echo " + If you would like to install the sample +"
|
|
|
|
@echo " + configuration files (overwriting any +"
|
|
|
|
@echo " + existing config files), run: +"
|
|
|
|
@echo " + +"
|
2003-04-23 16:23:12 +00:00
|
|
|
@echo " + $(MAKE) samples +"
|
2000-01-05 20:03:55 +00:00
|
|
|
@echo " + +"
|
2001-09-24 21:29:03 +00:00
|
|
|
@echo " +----------------- or ---------------------+"
|
|
|
|
@echo " + +"
|
|
|
|
@echo " + You can go ahead and install the asterisk +"
|
|
|
|
@echo " + program documentation now or later run: +"
|
|
|
|
@echo " + +"
|
2003-04-23 16:23:12 +00:00
|
|
|
@echo " + $(MAKE) progdocs +"
|
2001-09-24 21:29:03 +00:00
|
|
|
@echo " + +"
|
|
|
|
@echo " + **Note** This requires that you have +"
|
|
|
|
@echo " + doxygen installed on your local system +"
|
|
|
|
@echo " +-------------------------------------------+"
|
2005-05-01 01:43:44 +00:00
|
|
|
@$(MAKE) -s oldmodcheck
|
|
|
|
|
|
|
|
NEWMODS=$(notdir $(wildcard */*.so))
|
|
|
|
OLDMODS=$(filter-out $(NEWMODS),$(notdir $(wildcard $(DESTDIR)$(MODULES_DIR)/*.so)))
|
|
|
|
|
|
|
|
oldmodcheck:
|
2005-04-27 16:27:53 +00:00
|
|
|
@if [ -n "$(OLDMODS)" ]; then \
|
|
|
|
echo " WARNING WARNING WARNING" ;\
|
|
|
|
echo "" ;\
|
|
|
|
echo " Your Asterisk modules directory, located at" ;\
|
|
|
|
echo " $(DESTDIR)$(MODULES_DIR)" ;\
|
|
|
|
echo " contains modules that were not installed by this " ;\
|
|
|
|
echo " version of Asterisk. Please ensure that these" ;\
|
|
|
|
echo " modules are compatible with this version before" ;\
|
|
|
|
echo " attempting to run Asterisk." ;\
|
|
|
|
echo "" ;\
|
|
|
|
for f in $(OLDMODS); do \
|
|
|
|
echo " $$f" ;\
|
|
|
|
done ;\
|
|
|
|
echo "" ;\
|
|
|
|
echo " WARNING WARNING WARNING" ;\
|
|
|
|
fi
|
2003-02-04 16:35:12 +00:00
|
|
|
|
|
|
|
install: all datafiles bininstall
|
|
|
|
|
|
|
|
upgrade: all bininstall
|
|
|
|
|
2002-06-21 01:40:13 +00:00
|
|
|
adsi: all
|
2003-10-25 17:27:53 +00:00
|
|
|
mkdir -p $(DESTDIR)$(ASTETCDIR)
|
2002-06-21 01:40:13 +00:00
|
|
|
for x in configs/*.adsi; do \
|
2003-10-25 17:27:53 +00:00
|
|
|
if ! [ -f $(DESTDIR)$(ASTETCDIRX)/$$x ]; then \
|
|
|
|
install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
|
2002-06-21 01:40:13 +00:00
|
|
|
fi ; \
|
|
|
|
done
|
|
|
|
|
|
|
|
samples: all datafiles adsi
|
2003-10-25 17:27:53 +00:00
|
|
|
mkdir -p $(DESTDIR)$(ASTETCDIR)
|
2000-01-05 20:03:55 +00:00
|
|
|
for x in configs/*.sample; do \
|
2003-10-25 17:27:53 +00:00
|
|
|
if [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
|
2004-11-19 14:04:57 +00:00
|
|
|
if [ "$(OVERWRITE)" = "y" ]; then \
|
2004-11-20 06:47:33 +00:00
|
|
|
if cmp -s $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $$x ; then \
|
|
|
|
echo "Config file $$x is unchanged"; \
|
|
|
|
continue; \
|
|
|
|
fi ; \
|
2004-11-19 14:04:57 +00:00
|
|
|
mv -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample`.old ; \
|
|
|
|
else \
|
|
|
|
echo "Skipping config file $$x"; \
|
|
|
|
continue; \
|
|
|
|
fi ;\
|
2000-01-05 20:03:55 +00:00
|
|
|
fi ; \
|
2004-01-14 06:48:38 +00:00
|
|
|
install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
|
2000-01-05 20:03:55 +00:00
|
|
|
done
|
2004-11-19 14:04:57 +00:00
|
|
|
if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTETCDIR)/asterisk.conf ]; then \
|
|
|
|
echo "[directories]" > $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
|
|
|
echo "astetcdir => $(ASTETCDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
|
|
|
echo "astmoddir => $(MODULES_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
|
|
|
echo "astvarlibdir => $(ASTVARLIBDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
|
|
|
echo "astagidir => $(AGI_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
|
|
|
echo "astspooldir => $(ASTSPOOLDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
|
|
|
echo "astrundir => $(ASTVARRUNDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
|
|
|
echo "astlogdir => $(ASTLOGDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
2005-02-11 21:16:34 +00:00
|
|
|
echo "" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
|
|
|
echo "; Changing the following lines may compromise your security." >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
|
|
|
echo ";[files]" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
|
|
|
echo ";astctlpermissions = 0660" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
|
|
|
echo ";astctlowner = root" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
|
|
|
echo ";astctlgroup = apache" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
|
|
|
echo ";astctl = asterisk.ctl" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf ; \
|
2004-11-19 14:04:57 +00:00
|
|
|
else \
|
|
|
|
echo "Skipping asterisk.conf creation"; \
|
|
|
|
fi
|
2000-01-05 20:03:55 +00:00
|
|
|
for x in sounds/demo-*; do \
|
2004-12-14 23:36:30 +00:00
|
|
|
if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
|
2004-01-14 06:48:38 +00:00
|
|
|
install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
|
2003-02-04 16:35:12 +00:00
|
|
|
else \
|
|
|
|
echo "No description for $$x"; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
2000-01-05 20:03:55 +00:00
|
|
|
done
|
2002-06-21 01:40:13 +00:00
|
|
|
for x in sounds/*.mp3; do \
|
2004-01-14 06:48:38 +00:00
|
|
|
install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
|
2002-06-21 01:40:13 +00:00
|
|
|
done
|
2004-08-01 14:19:04 +00:00
|
|
|
rm -f $(DESTDIR)$(ASTVARLIBDIR)/mohmp3/sample-hold.mp3
|
2003-10-25 17:27:53 +00:00
|
|
|
mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX
|
2004-01-08 16:52:11 +00:00
|
|
|
:> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm
|
2000-01-05 20:03:55 +00:00
|
|
|
for x in vm-theperson digits/1 digits/2 digits/3 digits/4 vm-isunavail; do \
|
2004-01-08 16:52:11 +00:00
|
|
|
cat $(DESTDIR)$(ASTVARLIBDIR)/sounds/$$x.gsm >> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm ; \
|
2000-01-05 20:03:55 +00:00
|
|
|
done
|
2004-02-07 07:13:33 +00:00
|
|
|
:> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/busy.gsm
|
2000-01-05 20:03:55 +00:00
|
|
|
for x in vm-theperson digits/1 digits/2 digits/3 digits/4 vm-isonphone; do \
|
2004-01-08 16:52:11 +00:00
|
|
|
cat $(DESTDIR)$(ASTVARLIBDIR)/sounds/$$x.gsm >> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/busy.gsm ; \
|
2000-01-05 20:03:55 +00:00
|
|
|
done
|
2001-09-24 21:29:03 +00:00
|
|
|
|
2002-06-21 01:40:13 +00:00
|
|
|
webvmail:
|
2003-10-25 17:27:53 +00:00
|
|
|
@[ -d $(DESTDIR)$(HTTPDIR) ] || ( echo "No HTTP directory" && exit 1 )
|
|
|
|
@[ -d $(DESTDIR)$(HTTPDIR)/html ] || ( echo "No http directory" && exit 1 )
|
|
|
|
@[ -d $(DESTDIR)$(HTTPDIR)/cgi-bin ] || ( echo "No cgi-bin directory" && exit 1 )
|
2004-01-12 03:07:46 +00:00
|
|
|
install -m 4755 -o root -g root contrib/scripts/vmail.cgi $(DESTDIR)$(HTTPDIR)/cgi-bin/vmail.cgi
|
2003-10-25 17:27:53 +00:00
|
|
|
mkdir -p $(DESTDIR)$(HTTPDIR)/html/_asterisk
|
2002-06-21 01:40:13 +00:00
|
|
|
for x in images/*.gif; do \
|
2003-10-25 17:27:53 +00:00
|
|
|
install -m 644 $$x $(DESTDIR)$(HTTPDIR)/html/_asterisk/; \
|
2002-06-21 01:40:13 +00:00
|
|
|
done
|
|
|
|
@echo " +--------- Asterisk Web Voicemail ----------+"
|
|
|
|
@echo " + +"
|
|
|
|
@echo " + Asterisk Web Voicemail is installed in +"
|
|
|
|
@echo " + your cgi-bin directory. IT USES A SETUID +"
|
|
|
|
@echo " + ROOT PERL SCRIPT, SO IF YOU DON'T LIKE +"
|
|
|
|
@echo " + THAT, UNINSTALL IT! +"
|
|
|
|
@echo " + +"
|
|
|
|
@echo " +-------------------------------------------+"
|
|
|
|
|
2001-09-24 21:29:03 +00:00
|
|
|
mailbox:
|
2004-01-12 03:07:46 +00:00
|
|
|
./contrib/scripts/addmailbox
|
2001-09-24 21:29:03 +00:00
|
|
|
|
2005-02-04 05:44:13 +00:00
|
|
|
spec:
|
|
|
|
sed "s/^Version:.*/Version: $(RPMVERSION)/g" redhat/asterisk.spec > asterisk.spec ; \
|
|
|
|
|
2001-09-24 21:29:03 +00:00
|
|
|
rpm: __rpm
|
|
|
|
|
2005-02-04 05:44:13 +00:00
|
|
|
__rpm: _version spec
|
2001-09-24 21:29:03 +00:00
|
|
|
rm -rf /tmp/asterisk ; \
|
|
|
|
mkdir -p /tmp/asterisk/redhat/RPMS/i386 ; \
|
2003-10-25 17:27:53 +00:00
|
|
|
$(MAKE) DESTDIR=/tmp/asterisk install ; \
|
|
|
|
$(MAKE) DESTDIR=/tmp/asterisk samples ; \
|
2001-09-24 21:29:03 +00:00
|
|
|
mkdir -p /tmp/asterisk/etc/rc.d/init.d ; \
|
|
|
|
cp -f redhat/asterisk /tmp/asterisk/etc/rc.d/init.d/ ; \
|
2004-01-08 16:52:11 +00:00
|
|
|
rpmbuild --rcfile /usr/lib/rpm/rpmrc:redhat/rpmrc -bb asterisk.spec
|
2004-04-16 18:57:07 +00:00
|
|
|
|
2001-09-24 21:29:03 +00:00
|
|
|
progdocs:
|
2004-01-12 03:12:48 +00:00
|
|
|
doxygen contrib/asterisk-ng-doxygen
|
2002-06-21 01:40:13 +00:00
|
|
|
|
2004-08-07 01:26:09 +00:00
|
|
|
mpg123:
|
|
|
|
@wget -V >/dev/null || (echo "You need wget" ; false )
|
|
|
|
[ -f mpg123-0.59r.tar.gz ] || wget http://www.mpg123.de/mpg123/mpg123-0.59r.tar.gz
|
|
|
|
[ -d mpg123-0.59r ] || tar xfz mpg123-0.59r.tar.gz
|
2005-01-20 16:22:59 +00:00
|
|
|
$(MAKE) -C mpg123-0.59r $(MPG123TARG)
|
2004-08-07 01:26:09 +00:00
|
|
|
|
2002-06-21 01:40:13 +00:00
|
|
|
config:
|
|
|
|
if [ -d /etc/rc.d/init.d ]; then \
|
2004-01-12 03:12:48 +00:00
|
|
|
install -m 755 contrib/init.d/rc.redhat.asterisk /etc/rc.d/init.d/asterisk; \
|
2002-06-21 01:40:13 +00:00
|
|
|
/sbin/chkconfig --add asterisk; \
|
|
|
|
elif [ -d /etc/init.d ]; then \
|
|
|
|
install -m 755 init.asterisk /etc/init.d/asterisk; \
|
|
|
|
fi
|
|
|
|
|
2003-03-18 06:00:18 +00:00
|
|
|
dont-optimize:
|
2003-04-23 16:23:12 +00:00
|
|
|
$(MAKE) OPTIMIZE= K6OPT= install
|
2003-03-18 06:00:18 +00:00
|
|
|
|
|
|
|
valgrind: dont-optimize
|
2003-05-06 00:00:20 +00:00
|
|
|
|
|
|
|
depend: .depend
|
|
|
|
for x in $(SUBDIRS); do $(MAKE) -C $$x depend || exit 1 ; done
|
|
|
|
|
2003-09-27 02:32:30 +00:00
|
|
|
.depend:
|
2003-05-06 00:00:20 +00:00
|
|
|
./mkdep ${CFLAGS} `ls *.c`
|
|
|
|
|
2005-04-01 21:18:39 +00:00
|
|
|
.tags-depend:
|
|
|
|
@echo -n ".tags-depend: " > $@
|
|
|
|
@find . -maxdepth 1 -name \*.c -printf "\t%p \\\\\n" >> $@
|
|
|
|
@find . -maxdepth 1 -name \*.h -printf "\t%p \\\\\n" >> $@
|
|
|
|
@find ${SUBDIRS} -name \*.c -printf "\t%p \\\\\n" >> $@
|
|
|
|
@find ${SUBDIRS} -name \*.h -printf "\t%p \\\\\n" >> $@
|
|
|
|
@find include -name \*.h -printf "\t%p \\\\\n" >> $@
|
|
|
|
@echo >> $@
|
|
|
|
|
|
|
|
.tags-sources:
|
|
|
|
@rm -f $@
|
|
|
|
@find . -maxdepth 1 -name \*.c -print >> $@
|
|
|
|
@find . -maxdepth 1 -name \*.h -print >> $@
|
|
|
|
@find ${SUBDIRS} -name \*.c -print >> $@
|
|
|
|
@find ${SUBDIRS} -name \*.h -print >> $@
|
|
|
|
@find include -name \*.h -print >> $@
|
|
|
|
|
|
|
|
tags: .tags-depend .tags-sources
|
|
|
|
ctags -L .tags-sources -o $@
|
|
|
|
|
|
|
|
ctags: tags
|
|
|
|
|
|
|
|
TAGS: .tags-depend .tags-sources
|
|
|
|
etags -o $@ `cat .tags-sources`
|
|
|
|
|
|
|
|
etags: TAGS
|
|
|
|
|
2003-09-27 15:52:17 +00:00
|
|
|
FORCE:
|
2004-04-16 18:57:07 +00:00
|
|
|
|
|
|
|
%_env:
|
2005-01-20 16:22:59 +00:00
|
|
|
$(MAKE) -C $(shell echo $@ | sed "s/_env//g") env
|
2004-04-16 18:57:07 +00:00
|
|
|
|
|
|
|
env:
|
2004-04-27 21:30:32 +00:00
|
|
|
env
|
2005-01-17 04:48:51 +00:00
|
|
|
|
|
|
|
# If the cleancount has been changed, force a make clean.
|
|
|
|
# .cleancount is the global clean count, and .lastclean is the
|
2005-04-01 21:18:39 +00:00
|
|
|
# last clean count we had
|
2005-01-17 04:48:51 +00:00
|
|
|
# We can avoid this by making noclean
|
|
|
|
|
|
|
|
cleantest:
|
|
|
|
if ! cmp -s .cleancount .lastclean ; then \
|
2005-01-20 16:22:59 +00:00
|
|
|
$(MAKE) clean; cp -f .cleancount .lastclean;\
|
2005-01-17 04:48:51 +00:00
|
|
|
fi
|
2005-03-11 08:24:23 +00:00
|
|
|
|
|
|
|
patchlist:
|
|
|
|
@echo "Experimental Patches:"
|
|
|
|
@for x in patches/*; do \
|
|
|
|
patch=`basename $$x`; \
|
|
|
|
if [ "$$patch" = "CVS" ]; then \
|
|
|
|
continue; \
|
|
|
|
fi; \
|
|
|
|
if grep -q ^$$patch$$ patches/.applied; then \
|
|
|
|
echo "$$patch (applied)"; \
|
|
|
|
else \
|
|
|
|
echo "$$patch (available)"; \
|
|
|
|
fi; \
|
|
|
|
done
|
2005-04-01 21:18:39 +00:00
|
|
|
|
2005-03-11 08:24:23 +00:00
|
|
|
apply:
|
|
|
|
@if [ -z "$(PATCH)" ]; then \
|
2005-03-11 08:33:39 +00:00
|
|
|
echo "Usage: make PATCH=<patchname> apply"; \
|
2005-03-11 08:24:23 +00:00
|
|
|
elif grep -q ^$(PATCH)$$ patches/.applied 2>/dev/null; then \
|
|
|
|
echo "Patch $(PATCH) is already applied"; \
|
|
|
|
elif [ -f "patches/$(PATCH)" ]; then \
|
|
|
|
echo "Applying patch $(PATCH)"; \
|
|
|
|
patch -p0 < patches/$(PATCH); \
|
|
|
|
echo "$(PATCH)" >> patches/.applied; \
|
|
|
|
else \
|
|
|
|
echo "No such patch $(PATCH) in patches directory"; \
|
|
|
|
fi
|
2005-04-01 21:18:39 +00:00
|
|
|
|
2005-03-11 08:24:23 +00:00
|
|
|
unapply:
|
|
|
|
@if [ -z "$(PATCH)" ]; then \
|
2005-03-11 08:33:39 +00:00
|
|
|
echo "Usage: make PATCH=<patchname> unapply"; \
|
2005-03-11 08:49:01 +00:00
|
|
|
elif ! grep -q ^$(PATCH)$$ patches/.applied 2>/dev/null; then \
|
2005-03-11 08:24:23 +00:00
|
|
|
echo "Patch $(PATCH) is not applied"; \
|
|
|
|
elif [ -f "patches/$(PATCH)" ]; then \
|
|
|
|
echo "Un-applying patch $(PATCH)"; \
|
|
|
|
patch -p0 -R < patches/$(PATCH); \
|
|
|
|
rm -f patches/.tmpapplied || :; \
|
|
|
|
mv patches/.applied patches/.tmpapplied; \
|
|
|
|
cat patches/.tmpapplied | grep -v ^$(PATCH)$$ > patches/.applied; \
|
|
|
|
rm -f patches/.tmpapplied; \
|
|
|
|
else \
|
|
|
|
echo "No such patch $(PATCH) in patches directory"; \
|
|
|
|
fi
|