Merge branch 'maint' into branch-1.11
[automake.git] / m4 / make.m4
blob68d15b9d9afbf0d13f2162b4b973028bd44ea137
1 # Check to see how 'make' treats includes.                  -*- Autoconf -*-
3 # Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # serial 4
11 # AM_MAKE_INCLUDE()
12 # -----------------
13 # Check to see how make treats includes.
14 AC_DEFUN([AM_MAKE_INCLUDE],
15 [am_make=${MAKE-make}
16 cat > confinc << 'END'
17 am__doit:
18         @echo this is the am__doit target
19 .PHONY: am__doit
20 END
21 # If we don't find an include directive, just comment out the code.
22 AC_MSG_CHECKING([for style of include used by $am_make])
23 am__include="#"
24 am__quote=
25 _am_result=none
26 # First try GNU make style include.
27 echo "include confinc" > confmf
28 # Ignore all kinds of additional output from `make'.
29 case `$am_make -s -f confmf 2> /dev/null` in #(
30 *the\ am__doit\ target*)
31   am__include=include
32   am__quote=
33   _am_result=GNU
34   ;;
35 esac
36 # Now try BSD make style include.
37 if test "$am__include" = "#"; then
38    echo '.include "confinc"' > confmf
39    case `$am_make -s -f confmf 2> /dev/null` in #(
40    *the\ am__doit\ target*)
41      am__include=.include
42      am__quote="\""
43      _am_result=BSD
44      ;;
45    esac
47 AC_SUBST([am__include])
48 AC_SUBST([am__quote])
49 AC_MSG_RESULT([$_am_result])
50 rm -f confinc confmf