1# Check to see how 'make' treats includes. -*- Autoconf -*- 2 3# Copyright (C) 2001-2021 Free Software Foundation, Inc. 4# 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. 8 9# AM_MAKE_INCLUDE() 10# ----------------- 11# Check whether make has an 'include' directive that can support all 12# the idioms we need for our automatic dependency tracking code. 13AC_DEFUN([AM_MAKE_INCLUDE], 14[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) 15cat > confinc.mk << 'END' 16am__doit: 17 @echo this is the am__doit target >confinc.out 18.PHONY: am__doit 19END 20am__include="#" 21am__quote= 22# BSD make does it like this. 23echo '.include "confinc.mk" # ignored' > confmf.BSD 24# Other make implementations (GNU, Solaris 10, AIX) do it like this. 25echo 'include confinc.mk # ignored' > confmf.GNU 26_am_result=no 27for s in GNU BSD; do 28 AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) 29 AS_CASE([$?:`cat confinc.out 2>/dev/null`], 30 ['0:this is the am__doit target'], 31 [AS_CASE([$s], 32 [BSD], [am__include='.include' am__quote='"'], 33 [am__include='include' am__quote=''])]) 34 if test "$am__include" != "#"; then 35 _am_result="yes ($s style)" 36 break 37 fi 38done 39rm -f confinc.* confmf.* 40AC_MSG_RESULT([${_am_result}]) 41AC_SUBST([am__include])]) 42AC_SUBST([am__quote])]) 43