2005-11-12 16:27:19 -05:00
EXTRA_DIST =
2005-12-21 11:24:37 -05:00
SUBDIRS =
2006-01-20 13:21:32 -05:00
AUTOMAKE_OPTS = gnu
2005-11-12 16:27:19 -05:00
MAKE = gmake
NAME = freeswitch
2006-01-02 13:31:50 -05:00
PREFIX = $( prefix)
2005-11-12 16:27:19 -05:00
APR_CONFIG = $( prefix) /bin/apr-1-config
2005-12-21 17:38:53 -05:00
APU_CONFIG = $( prefix) /bin/apu-1-config
2006-01-20 13:21:32 -05:00
AM_CFLAGS = -I$( PREFIX) /include $( shell $( APR_CONFIG) --cflags --cppflags --includes)
AM_LDFLAGS = -L$( PREFIX) /lib
AM_LDFLAGS += $( shell $( APR_CONFIG) --link-ld --libs )
AM_CFLAGS += $( shell $( APU_CONFIG) --includes)
2005-12-28 00:17:21 -05:00
AM_LDFLAGS += $( shell $( APU_CONFIG) --link-ld --libs ) -lsqlite3
2006-01-20 13:21:32 -05:00
AM_LDFLAGS += -lresample -lm -L/usr/local/lib/db42 -L/usr/local/lib
2005-11-18 19:10:16 -05:00
OSARCH = $( shell uname -s)
i f I S L I N U X
AM_LDFLAGS += -Wl,-E
e n d i f
2006-01-25 18:59:02 -05:00
i f I S 6 4 B I T L I N U X
2006-01-30 10:53:38 -05:00
AM_CFLAGS += -m64 -march= k8 -fPIC
2006-01-25 18:59:02 -05:00
e n d i f
2005-12-13 16:26:03 -05:00
i f I S M A C
SOLINK = -dynamic -bundle -undefined suppress -force_flat_namespace
2005-12-26 14:45:58 -05:00
AM_CFLAGS += -DMACOSX -DSWAP_LINEAR
2005-12-13 16:30:10 -05:00
e l s e
SOLINK = -shared -Xlinker -x
2005-12-13 16:26:03 -05:00
e n d i f
2006-01-20 13:21:32 -05:00
2005-11-18 19:10:16 -05:00
2005-11-12 16:27:19 -05:00
AM_CFLAGS += -fPIC -Wall
2005-12-21 11:24:37 -05:00
AM_CFLAGS += -I$( PWD) /src/sqlite -I$( PWD) -I$( PWD) /src/include -I$( PREFIX) /include
2005-11-12 16:27:19 -05:00
AM_CFLAGS += -DSWITCH_MOD_DIR= \" $( PREFIX) /mod\"
AM_CFLAGS += -DSWITCH_PREFIX_DIR= \" $( PREFIX) \"
AM_CFLAGS += -DSWITCH_CONF_DIR= \" $( PREFIX) /conf\"
2005-12-21 17:25:22 -05:00
AM_CFLAGS += -DSWITCH_DB_DIR= \" $( PREFIX) /db\"
2006-01-06 12:44:19 -05:00
2005-11-12 16:27:19 -05:00
libfreeswitch_la_SOURCES = \
s r c / i n c l u d e / s w i t c h . h \
s r c / i n c l u d e / s w i t c h _ c h a n n e l . h \
s r c / i n c l u d e / s w i t c h _ c o n f i g . h \
s r c / i n c l u d e / s w i t c h _ c o n s o l e . h \
s r c / i n c l u d e / s w i t c h _ c o r e . h \
s r c / i n c l u d e / s w i t c h _ f r a m e . h \
s r c / i n c l u d e / s w i t c h _ l o a d a b l e _ m o d u l e . h \
s r c / i n c l u d e / s w i t c h _ m o d u l e _ i n t e r f a c e s . h \
s r c / i n c l u d e / s w i t c h _ m u t e x . h \
s r c / i n c l u d e / s w i t c h _ t y p e s . h \
s r c / i n c l u d e / s w i t c h _ u t i l s . h \
s r c / i n c l u d e / s w i t c h _ c a l l e r . h \
s r c / i n c l u d e / s w i t c h _ b u f f e r . h \
2005-12-13 20:40:51 -05:00
s r c / i n c l u d e / s w i t c h _ e v e n t . h \
2006-01-26 12:57:25 -05:00
s r c / i n c l u d e / s w i t c h _ i v r . h \
2005-11-12 16:27:19 -05:00
s r c / s w i t c h _ b u f f e r . c \
s r c / s w i t c h _ c a l l e r . c \
s r c / s w i t c h _ c h a n n e l . c \
s r c / s w i t c h _ c o n f i g . c \
s r c / s w i t c h _ c o n s o l e . c \
s r c / s w i t c h _ c o r e . c \
s r c / s w i t c h _ l o a d a b l e _ m o d u l e . c \
s r c / s w i t c h _ m u t e x . c \
2005-12-13 14:53:29 -05:00
s r c / s w i t c h _ u t i l s . c \
2006-01-05 21:07:24 -05:00
s r c / s w i t c h _ e v e n t . c \
2006-01-26 12:57:25 -05:00
s r c / s w i t c h _ r e s a m p l e . c \
s r c / s w i t c h _ i v r . c
2006-01-05 21:01:11 -05:00
2005-12-21 11:24:37 -05:00
2005-11-12 16:27:19 -05:00
#bindir = $(PREFIX)/bin
#libdir = $(PREFIX)/lib
library_includedir = $( PREFIX) /include
library_include_HEADERS = src/include/switch.h \
src/include/switch_channel.h \
src/include/switch_config.h \
src/include/switch_console.h \
src/include/switch_core.h \
src/include/switch_frame.h \
src/include/switch_loadable_module.h \
src/include/switch_module_interfaces.h \
src/include/switch_mutex.h \
src/include/switch_types.h \
src/include/switch_utils.h \
src/include/switch_caller.h \
2005-12-13 14:53:29 -05:00
src/include/switch_buffer.h \
2006-01-02 13:31:50 -05:00
src/include/switch_event.h \
2006-01-26 12:57:25 -05:00
src/include/switch_resample.h \
src/include/switch_ivr.h
2005-11-12 16:27:19 -05:00
2006-01-05 21:01:11 -05:00
2005-11-12 16:27:19 -05:00
lib_LTLIBRARIES = libfreeswitch.la
libfreeswitch_la_CFLAGS = $( AM_CFLAGS) -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g
libfreeswitch_la_LDFLAGS = -version-info 1:0:0
bin_PROGRAMS = freeswitch
freeswitch_SOURCES = src/switch.c
freeswitch_CFLAGS = $( AM_CFLAGS)
2005-12-28 00:17:21 -05:00
freeswitch_LDFLAGS = -lfreeswitch
2006-01-06 12:44:19 -05:00
nodist_freeswitch_SOURCES = src/include/switch_version.h
2006-01-14 13:52:11 -05:00
BUILT_SOURCES = version depends
2006-01-06 12:44:19 -05:00
CLEANFILES = src/include/switch_version.h
version : Makefile
./checkversion.sh
2005-11-12 16:27:19 -05:00
2006-01-06 12:44:19 -05:00
newversion : Makefile
./checkversion.sh force
$( MAKE)
2005-12-28 10:42:49 -05:00
.nodepends :
2005-12-21 12:22:38 -05:00
touch .nodepends
2005-12-28 10:42:49 -05:00
nodepends : .nodepends
yesdepends :
rm .nodepends
2006-01-14 13:52:11 -05:00
.depend :
2006-01-02 13:31:50 -05:00
./buildlib.sh . install sqlite-3.2.8.tar.gz --prefix= $( PREFIX) --disable-tcl --enable-threadsafe
./buildlib.sh . install apr-1.2.2.tar.gz --prefix= $( PREFIX)
./buildlib.sh . install apr-util-1.2.2.tar.gz --with-apr= ../apr-1.2.2 --prefix= $( PREFIX)
./buildlib.sh . install libresample-0.1.3.tgz --prefix= $( PREFIX)
cp libs/libresample-0.1.3/*.a $( PREFIX) /lib
cp libs/libresample-0.1.3/include/* $( PREFIX) /include
2006-01-05 16:34:51 -05:00
ranlib $( PREFIX) /lib/libresample.a
2006-01-14 13:52:11 -05:00
touch .depend
depends : .depend
2005-12-20 18:17:30 -05:00
2005-11-12 16:27:19 -05:00
modules : $( NAME )
@echo making modules
2006-01-20 13:21:32 -05:00
@cd src/mod && for i in ` cat ../../modules.conf | grep -v \# ` ; do echo making $$ i ; DYLD_LIBRARY_PATH = " $( PREFIX) /lib: $DYLD_LIBRARY_PATH " LD_LIBRARY_PATH = " $( PREFIX) /lib: $LD_LIBRARY_PATH " PREFIX = " $( PREFIX) " BASE = " $( PWD) " OSARCH = " $( OSARCH) " SOLINK = " $( SOLINK) " LDFLAGS = " $( AM_LDFLAGS) -lfreeswitch " CFLAGS = " $( AM_CFLAGS) " CC = " $( CC) " MOD = " $$ i " $( PWD) /modmake.sh $( PWD) $$ i || exit 1; done
2005-11-12 16:27:19 -05:00
modclean :
2005-12-28 00:17:21 -05:00
@cd src/mod && for i in ` find . -type d -name mod_\* ` ; do echo making clean $$ i ; SOLINK = " $( SOLINK) " CFLAGS = " $( CFLAGS) " CC = " $( CC) " MOD = " $$ i " $( PWD) /modmake.sh $( PWD) $$ i clean || exit 1; done
2006-01-05 16:03:22 -05:00
everything : all modules
installall : install install_mod
wayclean : clean modclean
2006-01-03 17:36:56 -05:00
modwipe :
rm -f $( PREFIX) /mod/*.so
2005-11-12 16:27:19 -05:00
2005-12-28 10:42:49 -05:00
install_mod : modules
2005-11-12 16:27:19 -05:00
@echo Installing $( NAME)
2006-01-02 13:31:50 -05:00
@mkdir -p $( PREFIX) $( PREFIX) /conf $( PREFIX) /mod $( PREFIX) /db $( PREFIX) /bin
2006-01-27 13:37:54 -05:00
@if [ -f .libs/$( NAME) ] ; then /bin/cp -p .libs/$( NAME) $( PREFIX) /bin ; else /bin/cp -p ./$( NAME) $( PREFIX) /bin ; fi
2005-11-12 16:27:19 -05:00
@ln -sf $( PREFIX) /bin/$( NAME) /usr/bin
@echo Installing Modules
2006-01-03 17:36:56 -05:00
@cd src/mod && for i in ` cat ../../modules.conf | grep -v \# ` ; do echo making clean $$ i ; PREFIX = $( PREFIX) MOD = " $$ i " $( PWD) /modmake.sh $( PWD) $$ i install || exit 1; done
2005-11-12 16:27:19 -05:00
@echo done
2006-01-01 10:23:12 -05:00
dox :
2006-01-03 17:49:25 -05:00
cd docs && doxygen $( PWD) /docs/Doxygen.conf
2005-11-12 16:27:19 -05:00
eclean : clean
rm -f ` find . -type f -name \* ~`
rm -f ` find . -type f -name \. *~`
rm -f ` find . -type f -name \# \* `
rm -f ` find . -type f -name \. \# \* `
rm -f ` find . -type f -name core\* `
rm -f *.tar *.tgz *.gz
megaclean : eclean modclean
2006-01-25 23:21:06 -05:00
rm -fr .depend ` find . -name .complete`