From: Ralf Wildenhues Date: Sun, 19 Apr 2009 15:10:25 +0000 (+0200) Subject: Detect make `include' style also with parallel non-GNU make. X-Git-Tag: v1.11~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45060dd0031cba4439388b7ee6fc119b46903b6d;p=thirdparty%2Fautomake.git Detect make `include' style also with parallel non-GNU make. Parallel NetBSD make outputs `--- $target ---' messages, parallel HP-UX make outputs `Making target"$target"'. Just ignore all additional output for the include test. * m4/make.m4 (AM_MAKE_INCLUDE): Ignore additional output produced by `make' to relax `include' style detection. Signed-off-by: Ralf Wildenhues --- diff --git a/ChangeLog b/ChangeLog index 05608e2d2..c715a7035 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2009-04-19 Ralf Wildenhues + Detect make `include' style also with parallel non-GNU make. + Parallel NetBSD make outputs `--- $target ---' messages, + parallel HP-UX make outputs `Making target"$target"'. Just + ignore all additional output for the include test. + * m4/make.m4 (AM_MAKE_INCLUDE): Ignore additional output + produced by `make' to relax `include' style detection. + manual: add FAQ `Debugging Make Rules'. * doc/automake.texi (Debugging Make Rules): New FAQ section. (Top, FAQ): Adjust menus, and capitalization of the description diff --git a/m4/make.m4 b/m4/make.m4 index 0969d9a79..68d15b9d9 100644 --- a/m4/make.m4 +++ b/m4/make.m4 @@ -1,12 +1,12 @@ # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 3 +# serial 4 # AM_MAKE_INCLUDE() # ----------------- @@ -15,7 +15,7 @@ AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: - @echo done + @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. @@ -25,24 +25,24 @@ am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf -# We grep out `Entering directory' and `Leaving directory' -# messages which can occur if `w' ends up in MAKEFLAGS. -# In particular we don't look at `^make:' because GNU make might -# be invoked under some other name (usually "gmake"), in which -# case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then - am__include=include - am__quote= - _am_result=GNU -fi +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf - if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then - am__include=.include - am__quote="\"" - _am_result=BSD - fi + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac fi AC_SUBST([am__include]) AC_SUBST([am__quote])