2005-11-12 16:27:19 -05:00
EXTRA_DIST =
2005-12-21 11:24:37 -05:00
SUBDIRS =
2005-11-12 16:27:19 -05:00
AUTOMAKE_OPTS = gnu
MAKE = gmake
NAME = freeswitch
PREFIX = $( prefix) /${ NAME }
APR_CONFIG = $( prefix) /bin/apr-1-config
2005-12-21 17:38:53 -05:00
APU_CONFIG = $( prefix) /bin/apu-1-config
2005-11-12 16:27:19 -05:00
AM_CFLAGS = $( shell $( APR_CONFIG) --cflags --cppflags --includes)
2005-12-21 17:38:53 -05:00
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
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
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
2005-12-14 13:11:49 -05:00
#AM_LDFLAGS += -L$(PREFIX)/lib
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\"
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 \
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 \
2005-12-21 11:24:37 -05:00
s r c / s w i t c h _ e v e n t . c
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 \
src/include/switch_event.h
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
2005-11-12 16:27:19 -05:00
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
2005-12-20 18:17:30 -05:00
depends :
2005-12-21 12:22:38 -05:00
./buildlib.sh . install sqlite-3.2.8.tar.gz --disable-tcl --enable-threadsafe
2005-12-21 17:25:22 -05:00
./buildlib.sh . install apr-1.2.2.tar.gz
2005-12-28 00:17:21 -05:00
./buildlib.sh . install apr-util-1.2.2.tar.gz --with-apr= ../apr-1.2.2
2005-12-20 18:17:30 -05:00
2005-11-12 16:27:19 -05:00
modules : $( NAME )
@echo making modules
2005-12-21 12:22:38 -05:00
@cd src/mod && for i in $( shell cat modules.conf | grep -v \# ) ; do echo making $$ i ; 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
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)
@mkdir -p $( PREFIX) $( PREFIX) /conf $( PREFIX) /mod $( PREFIX) /db
@/bin/cp -p ./$( NAME) $( PREFIX) /bin
@ln -sf $( PREFIX) /bin/$( NAME) /usr/bin
@echo Installing Modules
@/bin/cp -f src/mod/*/mod_*.so $( PREFIX) /mod >/dev/null 2<& 1 || echo No modules to copy.
@echo done
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
rm -fr $( SQLITETAR) $( SQLITE) $( APR) $( APRTAR) $( SOX) $( SOXTAR) $( COMMONTAR)