forked from Mirrors/freeswitch
133 lines
3.9 KiB
Makefile
133 lines
3.9 KiB
Makefile
EXTRA_DIST =
|
|
SUBDIRS =
|
|
AUTOMAKE_OPTS = gnu
|
|
MAKE=gmake
|
|
NAME=freeswitch
|
|
PREFIX=$(prefix)/${NAME}
|
|
APR_CONFIG=$(prefix)/bin/apr-1-config
|
|
APU_CONFIG=$(prefix)/bin/apu-1-config
|
|
AM_CFLAGS = $(shell $(APR_CONFIG) --cflags --cppflags --includes)
|
|
AM_LDFLAGS = $(shell $(APR_CONFIG) --link-ld --libs )
|
|
AM_CFLAGS += $(shell $(APU_CONFIG) --includes)
|
|
AM_LDFLAGS += $(shell $(APU_CONFIG) --link-ld --libs ) -lsqlite3
|
|
OSARCH=$(shell uname -s)
|
|
if ISLINUX
|
|
AM_LDFLAGS += -Wl,-E
|
|
endif
|
|
|
|
if ISMAC
|
|
SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace
|
|
AM_CFLAGS += -DMACOSX -DSWAP_LINEAR
|
|
else
|
|
SOLINK=-shared -Xlinker -x
|
|
endif
|
|
|
|
|
|
#AM_LDFLAGS += -L$(PREFIX)/lib
|
|
|
|
|
|
AM_CFLAGS += -fPIC -Wall
|
|
AM_CFLAGS +=-I$(PWD)/src/sqlite -I$(PWD) -I$(PWD)/src/include -I$(PREFIX)/include
|
|
AM_CFLAGS += -DSWITCH_MOD_DIR=\"$(PREFIX)/mod\"
|
|
AM_CFLAGS += -DSWITCH_PREFIX_DIR=\"$(PREFIX)\"
|
|
AM_CFLAGS += -DSWITCH_CONF_DIR=\"$(PREFIX)/conf\"
|
|
AM_CFLAGS += -DSWITCH_DB_DIR=\"$(PREFIX)/db\"
|
|
|
|
libfreeswitch_la_SOURCES = \
|
|
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 \
|
|
src/include/switch_buffer.h \
|
|
src/include/switch_event.h \
|
|
src/switch_buffer.c \
|
|
src/switch_caller.c \
|
|
src/switch_channel.c \
|
|
src/switch_config.c \
|
|
src/switch_console.c \
|
|
src/switch_core.c \
|
|
src/switch_loadable_module.c \
|
|
src/switch_mutex.c \
|
|
src/switch_utils.c \
|
|
src/switch_event.c
|
|
|
|
|
|
#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 \
|
|
src/include/switch_buffer.h \
|
|
src/include/switch_event.h
|
|
|
|
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)
|
|
freeswitch_LDFLAGS = -lfreeswitch
|
|
|
|
|
|
.nodepends:
|
|
touch .nodepends
|
|
|
|
nodepends: .nodepends
|
|
|
|
yesdepends:
|
|
rm .nodepends
|
|
|
|
depends:
|
|
./buildlib.sh . install sqlite-3.2.8.tar.gz --disable-tcl --enable-threadsafe
|
|
./buildlib.sh . install apr-1.2.2.tar.gz
|
|
./buildlib.sh . install apr-util-1.2.2.tar.gz --with-apr=../apr-1.2.2
|
|
|
|
modules: $(NAME)
|
|
@echo making modules
|
|
@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
|
|
|
|
modclean:
|
|
@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
|
|
|
|
|
|
|
|
install_mod: modules
|
|
@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)
|