Hi,

this patch adds the check targets (eg. check_PROGRAMS) directly to the
dependencies of check-am, resulting in make spawning one command less
and better parallel build performance because make can decide whether
check_PROGRAMS need to be rebuild.

In a simple example in one of my projects (with "TESTS=" - so that no
tests are executed) it reduced the overall time for running make check
in an updated source tree by ~32%.

Please tell me if you are interested in this patch and want me to update
it to cvs HEAD.

Regards,
  Sven

PS: Please CC me for replies, as I'm not subscribed to this list.

PPS: I consider this patch being so trivial that no copyright assignment
should be necessary.
>From 6ada455fca7d178b1e6430dc56b41be7e3c031ef Mon Sep 17 00:00:00 2001
From: Sven Herzberg <[EMAIL PROTECTED]>
Date: Fri, 12 Oct 2007 18:22:05 +0200
Subject: [PATCH] Require one make job less (and improve knowlegde of make about the DAG)

	* automake.in: add the check targets directly to the dependencies of
	check-am
	* tests/Makefile.in: changed the Makefile.in according to automake's
	new output
---
 automake.in       |    7 +++----
 tests/Makefile.in |    3 +--
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/automake.in b/automake.in
index d7e48a1..d470312 100755
--- a/automake.in
+++ b/automake.in
@@ -4397,10 +4397,9 @@ sub do_check_merge_target ()
       # The check target must depend on the local equivalent of
       # `all', to ensure all the primary targets are built.  Then it
       # must build the local check rules.
-      $output_rules .= "check-am: all-am\n";
-      pretty_print_rule ("\t\$(MAKE) \$(AM_MAKEFLAGS)", "\t  ",
-			 @check)
-	if @check;
+      $output_rules .= "check-am: all-am";
+      $output_rules .= " ".join(" ",@check) if @check;
+      $output_rules .= "\n";
     }
   pretty_print_rule ("\t\$(MAKE) \$(AM_MAKEFLAGS)", "\t  ",
 		     @check_tests)
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 52a125a..fbf4e13 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -900,8 +900,7 @@ distdir: $(DISTFILES)
 	    || exit 1; \
 	  fi; \
 	done
-check-am: all-am
-	$(MAKE) $(AM_MAKEFLAGS) $(check_SCRIPTS)
+check-am: all-am $(check_SCRIPTS)
 	$(MAKE) $(AM_MAKEFLAGS) check-TESTS
 check: check-am
 all-am: Makefile
-- 
1.5.2.5

Reply via email to