Revision
15988
Author
mikej
Date
2009-12-17 13:14:47 -0600 (Thu, 17 Dec 2009)

Log Message

even better handling of build failures

Modified Paths

Diff

Modified: freeswitch/trunk/Makefile.am (15987 => 15988)


--- freeswitch/trunk/Makefile.am	2009-12-17 18:33:45 UTC (rev 15987)
+++ freeswitch/trunk/Makefile.am	2009-12-17 19:14:47 UTC (rev 15988)
@@ -1,5 +1,5 @@
 EXTRA_DIST =
-SUBDIRS = . src build
+SUBDIRS = . src
 AUTOMAKE_OPTS = foreign
 NAME=freeswitch
 PREFIX=$(prefix)
@@ -127,15 +127,40 @@
 
 $(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