2014-05-08 15:58:28 -04:00
|
|
|
-include modules.inc
|
|
|
|
|
2007-04-09 14:40:03 +00:00
|
|
|
all: $(OUR_MODULES)
|
2009-06-09 03:25:48 +00:00
|
|
|
clean: $(OUR_CLEAN_MODULES) $(OUR_DISABLED_CLEAN_MODULES)
|
2007-04-09 14:40:03 +00:00
|
|
|
install: $(OUR_INSTALL_MODULES)
|
2009-06-09 03:25:48 +00:00
|
|
|
uninstall: $(OUR_UNINSTALL_MODULES) $(OUR_DISABLED_UNINSTALL_MODULES)
|
2020-01-09 12:34:16 -07:00
|
|
|
print_tests: $(OUR_TEST_MODULES)
|
2020-01-14 20:12:18 +00:00
|
|
|
check: $(OUR_CHECK_MODULES)
|
2007-03-13 16:49:15 +00:00
|
|
|
|
2016-01-26 20:22:56 -05:00
|
|
|
mod_skypopen-all: mod_gsmopen-all
|
|
|
|
mod_gsmopen-all: mod_spandsp-all
|
|
|
|
mod_unimrcp-all: mod_sofia-all
|
2019-01-22 14:50:51 -05:00
|
|
|
mod_rayo-all: mod_dingaling-all
|
|
|
|
mod_ssml-all: mod_rayo-all
|
2016-01-26 20:22:56 -05:00
|
|
|
|
2020-01-14 20:12:18 +00:00
|
|
|
$(OUR_MODULES) $(OUR_CLEAN_MODULES) $(OUR_INSTALL_MODULES) $(OUR_UNINSTALL_MODULES) $(OUR_DISABLED_MODULES) $(OUR_DISABLED_CLEAN_MODULES) $(OUR_DISABLED_INSTALL_MODULES) $(OUR_DISABLED_UNINSTALL_MODULES) $(OUR_TEST_MODULES) $(OUR_CHECK_MODULES):
|
2007-04-03 10:53:47 +00:00
|
|
|
@set fnord $$MAKEFLAGS; amf=$$2; \
|
2007-04-09 14:40:03 +00:00
|
|
|
target=`echo $@ | sed -e 's|^.*-||'`; \
|
2008-02-19 01:00:44 +00:00
|
|
|
modname=`echo $@ | sed -e 's|-.*||' | sed -e 's|^.*/||'`; \
|
2016-01-26 20:22:56 -05:00
|
|
|
enabled=`echo $(CONF_MODULES) | grep -w $$modname`; \
|
|
|
|
if ! test -z "$$enabled"; then \
|
2020-04-02 23:17:32 +04:00
|
|
|
confmoddir=`cat $(switch_builddir)/modules.conf | sed -e 's| ||' | sed 's/|.*//' | grep $$modname$$ | sed -e 's|#||' | head -n 1`; \
|
|
|
|
modsource=`cat $(switch_builddir)/modules.conf | grep "$$modname.*|" | sed 's/.*|//' | head -n 1`; \
|
2016-01-26 20:22:56 -05:00
|
|
|
if test -z "$$confmoddir" ; then \
|
|
|
|
moddir=$@ ; \
|
|
|
|
buildmoddir=$(switch_builddir)/src/mod/$@ ;\
|
|
|
|
else \
|
2020-04-02 23:17:32 +04:00
|
|
|
if [[ $$confmoddir == /* ]]; then \
|
2016-01-26 20:22:56 -05:00
|
|
|
moddir="$$confmoddir" ; \
|
2020-04-02 23:17:32 +04:00
|
|
|
buildmoddir="$$moddir" ; \
|
|
|
|
else \
|
|
|
|
if test -d "$(switch_srcdir)/src/mod/$$confmoddir" ; then \
|
|
|
|
moddir="$(switch_srcdir)/src/mod/$$confmoddir" ; \
|
|
|
|
buildmoddir="$(switch_builddir)/src/mod/$$confmoddir" ; \
|
|
|
|
else \
|
|
|
|
if ! test -z "$$modsource" ; then \
|
|
|
|
moddir="$(switch_srcdir)/src/mod/outoftree/$$confmoddir" ; \
|
|
|
|
buildmoddir="$(switch_builddir)/src/mod/outoftree/$$confmoddir" ; \
|
|
|
|
if ! test -d "$$buildmoddir"; then \
|
|
|
|
echo "Cloning from git: $$modsource" ; \
|
|
|
|
mkdir -p $$buildmoddir ; \
|
|
|
|
git clone $$modsource $$buildmoddir ; \
|
|
|
|
fi ; \
|
|
|
|
if ! test -d "$$buildmoddir"; then \
|
|
|
|
echo ; echo "WARNING There is no $$buildmoddir...failing ;" ; \
|
|
|
|
fail=yes ; \
|
|
|
|
fi ; \
|
|
|
|
else \
|
|
|
|
moddir="$$confmoddir" ; \
|
|
|
|
buildmoddir="$(switch_builddir)/src/mod/$$confmoddir" ; \
|
|
|
|
fi ; \
|
|
|
|
fi ; \
|
|
|
|
fi ; \
|
|
|
|
fi ; \
|
|
|
|
if test -f "$$buildmoddir/bootstrap.sh" -a ! -f "$$buildmoddir/configure" -a ! -f "$$buildmoddir/configure.sh" ; then \
|
2020-06-04 12:28:07 -06:00
|
|
|
cd $$buildmoddir && MODDIR=$$moddir MODNAME=$$modname BASE=$(switch_builddir) PKG_CONFIG_PATH=$(switch_builddir)/build/standalone_module:$(PKG_CONFIG_PATH) eval $$buildmoddir/bootstrap.sh ; \
|
2020-04-02 23:17:32 +04:00
|
|
|
fi ; \
|
|
|
|
if test -f "$$buildmoddir/configure.sh" -a ! -f "$$buildmoddir/Makefile" ; then \
|
2020-06-04 12:28:07 -06:00
|
|
|
cd $$buildmoddir && MODDIR=$$moddir MODNAME=$$modname BASE=$(switch_builddir) PKG_CONFIG_PATH=$(switch_builddir)/build/standalone_module:$(PKG_CONFIG_PATH) eval $$buildmoddir/configure.sh ; \
|
2020-04-02 23:17:32 +04:00
|
|
|
else \
|
|
|
|
if test -f "$$buildmoddir/configure" -a ! -f "$$buildmoddir/Makefile" ; then \
|
2020-06-04 12:28:07 -06:00
|
|
|
cd $$buildmoddir && MODDIR=$$moddir MODNAME=$$modname BASE=$(switch_builddir) PKG_CONFIG_PATH=$(switch_builddir)/build/standalone_module:$(PKG_CONFIG_PATH) eval $$buildmoddir/configure ; \
|
2016-01-26 20:22:56 -05:00
|
|
|
fi ; \
|
2007-04-09 14:40:03 +00:00
|
|
|
fi ; \
|
2016-01-26 20:22:56 -05:00
|
|
|
if test -z "$$target" ; then target="all" ; fi ; \
|
2020-04-02 23:17:32 +04:00
|
|
|
if ! test -z "$$fail" || ! test -f $$moddir/$$modname.c && ! test -f $$moddir/$$modname.cpp && test $$modname != "mod_com_g729" ; \
|
2016-01-26 20:22:56 -05:00
|
|
|
then echo ; echo "WARNING $$modname is not a valid FreeSWITCH module dir, skipping it..." ; else \
|
2020-01-09 12:34:16 -07:00
|
|
|
if test "$$target" != "print_tests" ; then echo; echo making $$target $$modname ; fi;\
|
2016-01-26 20:22:56 -05:00
|
|
|
test -d "$$buildmoddir" || mkdir -p $$buildmoddir ; \
|
|
|
|
(if test -f "$$moddir/Makefile" ; then \
|
|
|
|
test -f "$$buildmoddir/Makefile" || cp $$moddir/Makefile $$buildmoddir/Makefile ; \
|
|
|
|
cd $$buildmoddir && MODDIR=$$moddir MODNAME=$$modname BASE=$(switch_builddir) $(MAKE) $(AM_MAKEFLAGS) $$target; \
|
|
|
|
else\
|
|
|
|
cd $$buildmoddir && MODDIR=$$moddir MODNAME=$$modname BASE=$(switch_builddir) $(MAKE) $(AM_MAKEFLAGS) -f $(switch_builddir)/build/modmake.rules $$target ;\
|
|
|
|
fi;) || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
|
|
|
fi; \
|
|
|
|
test -z "$$fail" ; \
|
|
|
|
fi;
|
2007-04-09 14:40:03 +00:00
|
|
|
|
2011-02-14 13:52:35 -06:00
|
|
|
mod_com_g729-activate:
|
|
|
|
cd $(switch_builddir)/src/mod/codecs/mod_com_g729 && $(MAKE) $(AM_MAKEFLAGS) activate
|
|
|
|
|
2007-04-09 14:40:03 +00:00
|
|
|
.DEFAULT:
|
2011-08-19 01:42:57 +00:00
|
|
|
@if test -z "`echo $@ | grep '\-all$$'`"; then $(MAKE) $(AM_MAKEFLAGS) $@-all ; else echo Unknown target `echo $@ | sed -e 's|-all||'`; exit 1; fi
|
2008-02-18 19:41:08 +00:00
|
|
|
|
|
|
|
|