From 97c7974433fab1d8565d7b159e83e8cddf60f668 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Thu, 17 Dec 2009 19:14:47 +0000 Subject: [PATCH] even better handling of build failures git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15988 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- Makefile.am | 43 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/Makefile.am b/Makefile.am index 2f7f68bbe5..a63d8ab6a0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ EXTRA_DIST = -SUBDIRS = . src build +SUBDIRS = . src AUTOMAKE_OPTS = foreign NAME=freeswitch PREFIX=$(prefix) @@ -127,15 +127,40 @@ libs/libnatpmp/getgateway.c $(top_builddir)/libfreeswitch_la-switch_console.lo: src/include/switch_version.h -MY_RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive -$(MY_RECURSIVE_TARGETS): $(bin_PROGRAMS) $(lib_LTLIBRARIES) +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): $(bin_PROGRAMS) $(lib_LTLIBRARIES) + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; \ + if test -z "$$fail" ; then \ + cd $(top_builddir)/build && $(MAKE) $(AM_MAKEFLAGS) $$target || exit 1; \ + fi ; if ENABLE_CPP libfreeswitch_la_SOURCES += src/switch_cpp.cpp