FS-8776 #resolve Support GNU make parallel builds
* Explicitly define dependency tree for several modules * Enable parallel builds for libtiff and libspandsp * Verify module is enabled before attempting build. Allows the virtual targets to be used for ordering without forcing a build dependency.
This commit is contained in:
parent
41c73013e9
commit
28c23ab147
|
@ -5,37 +5,44 @@ clean: $(OUR_CLEAN_MODULES) $(OUR_DISABLED_CLEAN_MODULES)
|
|||
install: $(OUR_INSTALL_MODULES)
|
||||
uninstall: $(OUR_UNINSTALL_MODULES) $(OUR_DISABLED_UNINSTALL_MODULES)
|
||||
|
||||
mod_skypopen-all: mod_gsmopen-all
|
||||
mod_gsmopen-all: mod_spandsp-all
|
||||
mod_unimrcp-all: mod_sofia-all
|
||||
|
||||
$(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):
|
||||
@set fnord $$MAKEFLAGS; amf=$$2; \
|
||||
target=`echo $@ | sed -e 's|^.*-||'`; \
|
||||
modname=`echo $@ | sed -e 's|-.*||' | sed -e 's|^.*/||'`; \
|
||||
confmoddir=`cat $(switch_builddir)/modules.conf | sed -e 's| ||' | grep $$modname$$ | sed -e 's|#||' | head -n 1`; \
|
||||
if test -z "$$confmoddir" ; then \
|
||||
moddir=$@ ; \
|
||||
buildmoddir=$(switch_builddir)/src/mod/$@ ;\
|
||||
else \
|
||||
if test -d "$(switch_srcdir)/src/mod/$$confmoddir" ; then \
|
||||
moddir="$(switch_srcdir)/src/mod/$$confmoddir" ; \
|
||||
buildmoddir="$(switch_builddir)/src/mod/$$confmoddir" ; \
|
||||
else \
|
||||
moddir="$$confmoddir" ; \
|
||||
buildmoddir="$(switch_builddir)/src/mod/$$confmoddir" ; \
|
||||
enabled=`echo $(CONF_MODULES) | grep -w $$modname`; \
|
||||
if ! test -z "$$enabled"; then \
|
||||
confmoddir=`cat $(switch_builddir)/modules.conf | sed -e 's| ||' | grep $$modname$$ | sed -e 's|#||' | head -n 1`; \
|
||||
if test -z "$$confmoddir" ; then \
|
||||
moddir=$@ ; \
|
||||
buildmoddir=$(switch_builddir)/src/mod/$@ ;\
|
||||
else \
|
||||
if test -d "$(switch_srcdir)/src/mod/$$confmoddir" ; then \
|
||||
moddir="$(switch_srcdir)/src/mod/$$confmoddir" ; \
|
||||
buildmoddir="$(switch_builddir)/src/mod/$$confmoddir" ; \
|
||||
else \
|
||||
moddir="$$confmoddir" ; \
|
||||
buildmoddir="$(switch_builddir)/src/mod/$$confmoddir" ; \
|
||||
fi ; \
|
||||
fi ; \
|
||||
fi ; \
|
||||
if test -z "$$target" ; then target="all" ; fi ; \
|
||||
if ! test -f $$moddir/$$modname.c && ! test -f $$moddir/$$modname.cpp && test $$modname != "mod_com_g729" ; \
|
||||
then echo ; echo "WARNING $$modname is not a valid FreeSWITCH module dir, skipping it..." ; else \
|
||||
echo ;\
|
||||
echo making $$target $$modname ;\
|
||||
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" ;
|
||||
if test -z "$$target" ; then target="all" ; fi ; \
|
||||
if ! test -f $$moddir/$$modname.c && ! test -f $$moddir/$$modname.cpp && test $$modname != "mod_com_g729" ; \
|
||||
then echo ; echo "WARNING $$modname is not a valid FreeSWITCH module dir, skipping it..." ; else \
|
||||
echo ;\
|
||||
echo making $$target $$modname ;\
|
||||
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;
|
||||
|
||||
mod_com_g729-activate:
|
||||
cd $(switch_builddir)/src/mod/codecs/mod_com_g729 && $(MAKE) $(AM_MAKEFLAGS) activate
|
||||
|
|
|
@ -16,9 +16,9 @@ mod_spandsp_la_LIBADD = $(switch_builddir)/libfreeswitch.la $(SPANDSP_LA) $(TI
|
|||
mod_spandsp_la_LDFLAGS = -avoid-version -module -no-undefined -shared
|
||||
|
||||
$(SPANDSP_LA): $(TIFF_LA) $(SPANDSP_DIR) $(SPANDSP_DIR)/.update
|
||||
cd $(SPANDSP_BUILDDIR) && $(MAKE) -j1 CPPFLAGS="$(CPPFLAGS) -I$(TIFF_BUILDDIR)/libtiff -I$(TIFF_DIR)/libtiff" CFLAGS="$(CFLAGS)"
|
||||
cd $(SPANDSP_BUILDDIR) && $(MAKE) CPPFLAGS="$(CPPFLAGS) -I$(TIFF_BUILDDIR)/libtiff -I$(TIFF_DIR)/libtiff" CFLAGS="$(CFLAGS)"
|
||||
$(TOUCH_TARGET)
|
||||
|
||||
$(TIFF_LA): $(TIFF_DIR) $(TIFF_DIR)/.update
|
||||
cd $(TIFF_BUILDDIR) && $(MAKE) -j1
|
||||
cd $(TIFF_BUILDDIR) && $(MAKE)
|
||||
$(TOUCH_TARGET)
|
||||
|
|
|
@ -19,9 +19,9 @@ mod_gsmopen_la_LDFLAGS = -avoid-version -module -no-undefined -lctb-0.16 -lgsmm
|
|||
BUILT_SOURCES = $(TIFF_LA) $(SPANDSP_LA)
|
||||
|
||||
$(SPANDSP_LA): $(TIFF_LA) $(SPANDSP_DIR) $(SPANDSP_DIR)/.update
|
||||
cd $(SPANDSP_BUILDDIR) && $(MAKE) -j1 CPPFLAGS="$(CPPFLAGS) -I$(TIFF_BUILDDIR)/libtiff -I$(TIFF_DIR)/libtiff" CFLAGS="$(CFLAGS)"
|
||||
cd $(SPANDSP_BUILDDIR) && $(MAKE) CPPFLAGS="$(CPPFLAGS) -I$(TIFF_BUILDDIR)/libtiff -I$(TIFF_DIR)/libtiff" CFLAGS="$(CFLAGS)"
|
||||
$(TOUCH_TARGET)
|
||||
|
||||
$(TIFF_LA): $(TIFF_DIR) $(TIFF_DIR)/.update
|
||||
cd $(TIFF_BUILDDIR) && $(MAKE) -j1
|
||||
cd $(TIFF_BUILDDIR) && $(MAKE)
|
||||
$(TOUCH_TARGET)
|
||||
|
|
|
@ -19,9 +19,9 @@ mod_skypopen_la_LDFLAGS = -avoid-version -module -no-undefined -shared -lX11
|
|||
BUILT_SOURCES = $(TIFF_LA) $(SPANDSP_LA)
|
||||
|
||||
$(SPANDSP_LA): $(TIFF_LA) $(SPANDSP_DIR) $(SPANDSP_DIR)/.update
|
||||
cd $(SPANDSP_BUILDDIR) && $(MAKE) -j1 CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS) -I$(TIFF_BUILDDIR)/libtiff -I$(TIFF_DIR)/libtiff"
|
||||
cd $(SPANDSP_BUILDDIR) && $(MAKE) CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS) -I$(TIFF_BUILDDIR)/libtiff -I$(TIFF_DIR)/libtiff"
|
||||
$(TOUCH_TARGET)
|
||||
|
||||
$(TIFF_LA): $(TIFF_DIR) $(TIFF_DIR)/.update
|
||||
cd $(TIFF_BUILDDIR) && $(MAKE) -j1
|
||||
cd $(TIFF_BUILDDIR) && $(MAKE)
|
||||
$(TOUCH_TARGET)
|
||||
|
|
Loading…
Reference in New Issue