2007-03-11 12:58:22 -04:00
|
|
|
@SET_MAKE@
|
|
|
|
|
|
|
|
switch_builddir=@switch_builddir@
|
|
|
|
switch_srcdir=@switch_srcdir@
|
|
|
|
|
|
|
|
CC=@CC@
|
2007-03-12 00:21:54 -04:00
|
|
|
CXX=@CXX@
|
2007-03-11 12:58:22 -04:00
|
|
|
AWK=@AWK@
|
|
|
|
SHELL=@SHELL@
|
|
|
|
INSTALL=@INSTALL@
|
2007-03-14 10:35:11 -04:00
|
|
|
GETLIB=@GETLIB@
|
2007-03-30 16:22:38 -04:00
|
|
|
LIBTOOL=@LIBTOOL@
|
2009-04-06 18:29:10 -04:00
|
|
|
LTINSTALL=$(LIBTOOL) --quiet --mode=install $(INSTALL)
|
2007-03-14 10:35:11 -04:00
|
|
|
LTUNINSTALL=$(LIBTOOL) --mode=uninstall rm -f
|
2007-03-12 00:21:54 -04:00
|
|
|
CCLD = $(CC)
|
|
|
|
CXXLD = $(CXX)
|
2007-03-11 12:58:22 -04:00
|
|
|
|
2007-03-14 14:59:25 -04:00
|
|
|
LIBCURL_DEPS=@LIBCURL_DEPS@
|
|
|
|
LIBCURL=@LIBCURL@
|
|
|
|
LIBCURL_CPPFLAGS=@LIBCURL_CPPFLAGS@
|
|
|
|
CURL_DIR=$(switch_srcdir)/libs/curl
|
|
|
|
CURLLA=$(CURL_DIR)/lib/libcurl.la
|
|
|
|
|
2007-03-11 12:58:22 -04:00
|
|
|
LIBS=$(switch_builddir)/libfreeswitch.la
|
|
|
|
DEFS=@DEFS@
|
|
|
|
PREFIX = @prefix@
|
2008-02-18 09:58:41 -05:00
|
|
|
MODINSTDIR = @modinstdir@
|
2007-03-11 12:58:22 -04:00
|
|
|
|
2008-02-18 17:21:43 -05:00
|
|
|
DYLD_LIBRARY_PATH=@libdir@:$DYLD_LIBRARY_PATH
|
|
|
|
LD_LIBRARY_PATH=@libdir@:$LD_LIBRARY_PATH
|
2007-03-17 01:49:57 -04:00
|
|
|
OSARCH=`uname -s`
|
2009-04-06 18:29:10 -04:00
|
|
|
LIBTOOL_LIB_EXTEN = @LIBTOOL_LIB_EXTEN@
|
2007-03-11 12:58:22 -04:00
|
|
|
SOLINK = @SOLINK@
|
|
|
|
|
2007-03-17 01:49:57 -04:00
|
|
|
LDFLAGS=@SWITCH_AM_LDFLAGS@ @LDFLAGS@ $(OUR_LDFLAGS)
|
|
|
|
|
2007-03-14 14:59:25 -04:00
|
|
|
ALL_CFLAGS = $(LOCAL_CFLAGS) $(MOD_CFLAGS) @SWITCH_AM_CFLAGS@ @CFLAGS@ -D_GNU_SOURCE $(OUR_CFLAGS)
|
2008-05-25 18:07:31 -04:00
|
|
|
ALL_CXXFLAGS = $(LOCAL_CFLAGS) $(MOD_CFLAGS) @SWITCH_AM_CXXFLAGS@ @CXXFLAGS@ -D_GNU_SOURCE $(OUR_CFLAGS)
|
2007-03-11 12:58:22 -04:00
|
|
|
|
2007-03-12 00:21:54 -04:00
|
|
|
COMPILE = $(CC) $(ALL_CFLAGS) $(DEFS)
|
|
|
|
LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(COMPILE)
|
2009-04-06 18:29:10 -04:00
|
|
|
LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(ALL_CFLAGS) $(LDFLAGS) -shared -module -avoid-version -rpath $(MODINSTDIR) -o $@
|
2007-03-11 12:58:22 -04:00
|
|
|
|
2007-03-12 00:21:54 -04:00
|
|
|
CXXCOMPILE = $(CXX) $(ALL_CXXFLAGS) $(DEFS)
|
|
|
|
LTCXXCOMPILE = $(LIBTOOL) --mode=compile --tag=CXX $(CXXCOMPILE)
|
2009-04-06 18:29:10 -04:00
|
|
|
CXXLINK = $(LIBTOOL) --mode=link --tag=CXX $(CXXLD) $(ALL_CXXFLAGS) $(LDFLAGS) -shared -module -avoid-version -rpath $(MODINSTDIR) -o $@
|
2007-03-11 12:58:22 -04:00
|
|
|
|
2007-03-17 01:49:57 -04:00
|
|
|
CSOURCEFILE=$(MODNAME).c
|
|
|
|
CXXSOURCEFILE=$(MODNAME).cpp
|
2007-03-30 16:22:38 -04:00
|
|
|
TOUCH_TARGET=@TOUCH_TARGET@
|
2007-03-17 01:49:57 -04:00
|
|
|
|
2007-03-18 12:45:57 -04:00
|
|
|
#MAKE_OPTS = `if test -z "$(VERBOSE)" ; then $(MAKE) --help | grep silent | grep "\-s" 2>&1 >/dev/null && echo -s;fi`
|
|
|
|
MAKE_OPTS = `test -n "$(VERBOSE)" || echo -s`
|
2007-03-17 01:49:57 -04:00
|
|
|
RECURSE_MODNAME=`pwd | sed -e 's|^.*/||'`
|
|
|
|
RECURSE_SOURCEFILE=`if test -f $$modname.cpp; then echo $$modname.cpp; else echo $$modname.c; fi`
|
2007-03-19 08:16:46 -04:00
|
|
|
RECURSE_OUR_DEPS=`test -z "$(WANT_CURL)" || if test ! -z "$(LIBCURL_DEPS)"; then echo $(CURLLA); fi `
|
2007-03-17 04:40:10 -04:00
|
|
|
RECURSE_OUR_CFLAGS=`test -z "$(WANT_CURL)" || echo $(LIBCURL_CPPFLAGS) ; $(LOCAL_INSERT_CFLAGS) `
|
|
|
|
RECURSE_OUR_LDFLAGS=`test -z "$(WANT_CURL)" || echo $(LIBCURL) ; $(LOCAL_INSERT_LDFLAGS) `
|
2007-03-17 21:52:23 -04:00
|
|
|
RECURSE_MAKE=modname="$(RECURSE_MODNAME)" ; \
|
|
|
|
sourcefile="$(RECURSE_SOURCEFILE)" ; \
|
|
|
|
osarch=`uname -s` ; \
|
|
|
|
ourdefs="$(RECURSE_OUR_DEPS)" ; \
|
|
|
|
ourcflags="$(RECURSE_OUR_CFLAGS)" ; \
|
|
|
|
ourldflags="$(RECURSE_OUR_LDFLAGS)" ; \
|
2007-03-19 08:16:46 -04:00
|
|
|
insertobjs="`$(LOCAL_INSERT_OBJS)`" ; \
|
|
|
|
$(MAKE) $(MAKE_OPTS) MODNAME="$$modname" SOURCEFILE="$$sourcefile" \
|
|
|
|
OUR_DEPS="$$ourdefs" OUR_CFLAGS="$$ourcflags" OUR_LDFLAGS="$$ourldflags" OUR_OBJS="$$insertobjs"
|
2007-03-17 01:49:57 -04:00
|
|
|
|
|
|
|
all: Makefile
|
2007-03-17 21:52:23 -04:00
|
|
|
@$(RECURSE_MAKE) all-modules || exit 1
|
2007-03-17 01:49:57 -04:00
|
|
|
depend: Makefile
|
2007-03-17 21:52:23 -04:00
|
|
|
@$(RECURSE_MAKE) depend-modules || exit 1
|
2007-03-17 01:49:57 -04:00
|
|
|
clean: Makefile
|
2007-03-17 21:52:23 -04:00
|
|
|
@$(RECURSE_MAKE) clean-modules || exit 1
|
2007-03-17 01:49:57 -04:00
|
|
|
install: Makefile
|
2007-03-17 21:52:23 -04:00
|
|
|
@$(RECURSE_MAKE) install-modules || exit 1
|
2007-03-17 01:49:57 -04:00
|
|
|
uninstall: Makefile
|
2007-03-17 21:52:23 -04:00
|
|
|
@$(RECURSE_MAKE) uninstall-modules || exit 1
|
2007-03-17 01:49:57 -04:00
|
|
|
distclean: Makefile
|
2007-03-17 21:52:23 -04:00
|
|
|
@$(RECURSE_MAKE) distclean-modules || exit 1
|
2007-03-17 01:49:57 -04:00
|
|
|
extraclean: Makefile
|
2007-03-17 21:52:23 -04:00
|
|
|
@$(RECURSE_MAKE) extraclean-modules || exit 1
|
2007-03-17 01:49:57 -04:00
|
|
|
|
2009-04-06 18:29:10 -04:00
|
|
|
all-modules: local_depend $(MODNAME).$(LIBTOOL_LIB_EXTEN) local_all Makefile
|
2007-03-17 01:49:57 -04:00
|
|
|
depend-modules: local_depend
|
|
|
|
clean-modules: local_clean mod_clean
|
2007-03-17 04:40:10 -04:00
|
|
|
install-modules: all-modules depend_install local_install mod_install
|
2007-03-17 01:49:57 -04:00
|
|
|
uninstall-modules: local_uninstall mod_uninstall
|
2007-03-17 04:40:10 -04:00
|
|
|
distclean-modules: clean-modules local_distclean
|
2007-03-17 01:49:57 -04:00
|
|
|
extraclean-modules: distclean local_extraclean
|
2007-03-12 00:21:54 -04:00
|
|
|
|
2007-03-13 10:43:40 -04:00
|
|
|
Makefile:
|
2007-03-17 01:49:57 -04:00
|
|
|
@if test ! -f $@; then \
|
2007-03-13 13:46:44 -04:00
|
|
|
if ! pwd | grep $(switch_srcdir)/src/mod ; then rulesdir=$(switch_srcdir) ; else rulesdir=../../../.. ; fi ; \
|
2007-03-17 01:49:57 -04:00
|
|
|
echo BASE=$$rulesdir > Makefile ; \
|
2008-05-10 12:01:27 -04:00
|
|
|
echo 'include $$(BASE)/build/modmake.rules' >> Makefile ; \
|
2007-03-13 10:43:40 -04:00
|
|
|
fi ;
|
2007-03-12 00:21:54 -04:00
|
|
|
|
2007-03-14 14:59:25 -04:00
|
|
|
$(CURLLA):
|
2007-03-18 01:20:35 -04:00
|
|
|
@cd $(CURL_DIR) && $(MAKE)
|
|
|
|
|
|
|
|
LINK_OUTPUT_REDIR=> .libs/$(MODNAME).log || error="yes" ; \
|
|
|
|
if test -n "$(VERBOSE)" -o "$$error" = "yes"; then \
|
|
|
|
cat .libs/$(MODNAME).log ; \
|
|
|
|
fi ;\
|
|
|
|
if test "$$error" = "yes"; then \
|
|
|
|
exit 1 ;\
|
|
|
|
fi
|
2007-03-14 14:59:25 -04:00
|
|
|
|
2009-04-06 18:29:10 -04:00
|
|
|
$(MODNAME).$(LIBTOOL_LIB_EXTEN): $(LIBS) $(LOCAL_LIBADD) $(OUR_DEPS) $(LOCAL_OBJS) $(OUR_OBJS) $(SOURCEFILE) $(MODNAME).lo
|
2007-03-18 01:20:35 -04:00
|
|
|
@echo Creating $@...
|
|
|
|
@test -d .libs || mkdir .libs
|
|
|
|
@error="";\
|
|
|
|
if test -f $(CSOURCEFILE); then \
|
2009-04-07 15:48:50 -04:00
|
|
|
$(LINK) $(SOLINK) $(MODNAME).lo $(LIBS) $(LOCAL_LDFLAGS) $(LOCAL_OBJS) $(OUR_OBJS) $(LOCAL_LIBADD) $(LOCAL_LDFLAGS_POST) $(LINK_OUTPUT_REDIR) ;\
|
2007-03-12 14:40:18 -04:00
|
|
|
else \
|
2009-04-07 15:48:50 -04:00
|
|
|
$(CXXLINK) $(SOLINK) $(MODNAME).lo $(LIBS) $(LOCAL_LDFLAGS) $(LOCAL_OBJS) $(OUR_OBJS) $(LOCAL_LIBADD) $(LOCAL_LDFLAGS_POST) $(LINK_OUTPUT_REDIR) ;\
|
2007-03-12 14:40:18 -04:00
|
|
|
fi;
|
2007-03-12 00:21:54 -04:00
|
|
|
|
|
|
|
mod_clean:
|
2009-04-06 18:29:10 -04:00
|
|
|
@rm -fr *.$(LIBTOOL_LIB_EXTEN) *.o *.lo *~ .libs $(LOCAL_OBJS)
|
2007-03-11 12:58:22 -04:00
|
|
|
|
2009-04-06 18:29:10 -04:00
|
|
|
mod_install: $(DESTDIR)$(MODINSTDIR)/$(MODNAME).$(LIBTOOL_LIB_EXTEN)
|
2007-03-14 21:32:18 -04:00
|
|
|
|
2009-04-06 18:29:10 -04:00
|
|
|
$(DESTDIR)$(MODINSTDIR)/$(MODNAME).$(LIBTOOL_LIB_EXTEN):$(MODNAME).$(LIBTOOL_LIB_EXTEN)
|
2007-03-18 19:20:30 -04:00
|
|
|
@echo installing $<
|
2009-04-06 18:29:10 -04:00
|
|
|
@$(LTINSTALL) $(MODNAME).$(LIBTOOL_LIB_EXTEN) $(DESTDIR)$(MODINSTDIR) >/dev/null
|
2007-03-11 12:58:22 -04:00
|
|
|
|
2007-03-14 10:35:11 -04:00
|
|
|
mod_uninstall:
|
2009-04-06 18:29:10 -04:00
|
|
|
@$(LTUNINSTALL) $(DESTDIR)$(MODINSTDIR)/$(MODNAME).$(LIBTOOL_LIB_EXTEN)
|
2007-03-14 10:35:11 -04:00
|
|
|
|
2007-03-12 00:21:54 -04:00
|
|
|
# define these in your makefile if you wish
|
2007-03-14 10:35:11 -04:00
|
|
|
local_all local_depend local_clean depend_install local_install local_distclean local_extraclean local_uninstall:
|
2007-03-11 12:58:22 -04:00
|
|
|
|
|
|
|
#
|
|
|
|
# Implicit rules for creating outputs from input files
|
|
|
|
#
|
|
|
|
.SUFFIXES:
|
2007-03-12 00:21:54 -04:00
|
|
|
.SUFFIXES: .c .lo .o .cpp
|
2007-03-11 12:58:22 -04:00
|
|
|
|
|
|
|
.c.o:
|
2007-03-18 01:20:35 -04:00
|
|
|
@echo Compiling $<...
|
|
|
|
@if test ! -z $(VERBOSE) ; then echo $(COMPILE) -c -o $@ $< ; fi
|
|
|
|
@$(COMPILE) -c -o $@ $< || exit 1
|
2007-03-11 12:58:22 -04:00
|
|
|
|
|
|
|
.c.lo:
|
2007-03-18 01:20:35 -04:00
|
|
|
@echo Compiling $<...
|
|
|
|
@if test ! -z $(VERBOSE) ; then echo $(LTCOMPILE) -c -o $@ $< ; fi
|
|
|
|
@$(LTCOMPILE) -c -o $@ $< || exit 1
|
2007-03-12 00:21:54 -04:00
|
|
|
|
|
|
|
.cpp.o:
|
2007-03-18 01:20:35 -04:00
|
|
|
@echo Compiling $<...
|
|
|
|
@if test ! -z $(VERBOSE) ; then echo $(CXXCOMPILE) -c -o $@ $< ; fi
|
|
|
|
@$(CXXCOMPILE) -c -o $@ $< || exit 1
|
2007-03-12 00:21:54 -04:00
|
|
|
|
|
|
|
.cpp.lo:
|
2007-03-18 01:20:35 -04:00
|
|
|
@echo Compiling $<...
|
|
|
|
@if test ! -z $(VERBOSE) ; then echo $(LTCXXCOMPILE) -c -o $@ $< ; fi
|
|
|
|
@$(LTCXXCOMPILE) -c -o $@ $< || exit 1
|
2007-03-12 00:21:54 -04:00
|
|
|
|
2007-03-18 01:20:35 -04:00
|
|
|
$(MODNAME).o $(MODNAME).lo: $(SOURCEFILE) \
|
2007-03-16 16:21:33 -04:00
|
|
|
$(switch_srcdir)/src/include/switch.h $(switch_srcdir)/src/include/switch_am_config.h \
|
|
|
|
$(switch_srcdir)/src/include/switch_types.h $(switch_srcdir)/src/include/switch_apr.h \
|
|
|
|
$(switch_srcdir)/src/include/switch_core_db.h $(switch_srcdir)/src/include/switch_regex.h \
|
|
|
|
$(switch_srcdir)/src/include/switch_core.h $(switch_srcdir)/src/include/switch_loadable_module.h \
|
|
|
|
$(switch_srcdir)/src/include/switch_console.h $(switch_srcdir)/src/include/switch_utils.h \
|
|
|
|
$(switch_srcdir)/src/include/switch_caller.h $(switch_srcdir)/src/include/switch_config.h \
|
|
|
|
$(switch_srcdir)/src/include/switch_frame.h $(switch_srcdir)/src/include/switch_module_interfaces.h \
|
|
|
|
$(switch_srcdir)/src/include/switch_channel.h $(switch_srcdir)/src/include/switch_buffer.h \
|
|
|
|
$(switch_srcdir)/src/include/switch_event.h $(switch_srcdir)/src/include/switch_resample.h \
|
|
|
|
$(switch_srcdir)/src/include/switch_ivr.h $(switch_srcdir)/src/include/switch_rtp.h \
|
|
|
|
$(switch_srcdir)/src/include/switch_stun.h $(switch_srcdir)/src/include/switch_log.h \
|
|
|
|
$(switch_srcdir)/src/include/switch_xml.h
|
|
|
|
|
|
|
|
$(switch_srcdir)/src/include/switch.h:
|
|
|
|
|
|
|
|
$(switch_srcdir)/src/include/switch_am_config.h:
|
|
|
|
|
|
|
|
$(switch_srcdir)/src/include/switch_types.h:
|
|
|
|
|
|
|
|
$(switch_srcdir)/src/include/switch_apr.h:
|
|
|
|
|
|
|
|
$(switch_srcdir)/src/include/switch_core_db.h:
|
|
|
|
|
|
|
|
$(switch_srcdir)/src/include/switch_regex.h:
|
|
|
|
|
|
|
|
$(switch_srcdir)/src/include/switch_core.h:
|
|
|
|
|
|
|
|
$(switch_srcdir)/src/include/switch_loadable_module.h:
|
|
|
|
|
|
|
|
$(switch_srcdir)/src/include/switch_console.h:
|
|
|
|
|
|
|
|
$(switch_srcdir)/src/include/switch_utils.h:
|
|
|
|
|
|
|
|
$(switch_srcdir)/src/include/switch_caller.h:
|
|
|
|
|
|
|
|
$(switch_srcdir)/src/include/switch_config.h:
|
|
|
|
|
|
|
|
$(switch_srcdir)/src/include/switch_frame.h:
|
|
|
|
|
|
|
|
$(switch_srcdir)/src/include/switch_module_interfaces.h:
|
|
|
|
|
|
|
|
$(switch_srcdir)/src/include/switch_channel.h:
|
|
|
|
|
|
|
|
$(switch_srcdir)/src/include/switch_buffer.h:
|
|
|
|
|
|
|
|
$(switch_srcdir)/src/include/switch_event.h:
|
|
|
|
|
|
|
|
$(switch_srcdir)/src/include/switch_resample.h:
|
|
|
|
|
|
|
|
$(switch_srcdir)/src/include/switch_ivr.h:
|
|
|
|
|
|
|
|
$(switch_srcdir)/src/include/switch_rtp.h:
|
|
|
|
|
|
|
|
$(switch_srcdir)/src/include/switch_stun.h:
|
|
|
|
|
|
|
|
$(switch_srcdir)/src/include/switch_log.h:
|
|
|
|
|
|
|
|
$(switch_srcdir)/src/include/switch_xml.h:
|
2007-03-11 12:58:22 -04:00
|
|
|
|
2007-03-17 01:49:57 -04:00
|
|
|
|
|
|
|
.PHONY: all clean depend install distclean extraclean \
|
|
|
|
all-modules clean-modules depend-modules install-modules distclean-modules extraclean-modules \
|
|
|
|
local_all local_clean local_depend local_install local_distclean local_extraclean \
|
|
|
|
mod_clean mod_install mod_uninstall depend_install
|