This is the mail archive of the
automake@gnu.org
mailing list for the automake project.
Re: Supporting include in Makefiles
- To: Dean Povey <povey at dstc dot qut dot edu dot au>
- Subject: Re: Supporting include in Makefiles
- From: Akim Demaille <akim at epita dot fr>
- Date: 28 Jun 2001 18:35:06 +0200
- Cc: autoconf at gnu dot org, automake at gnu dot org
- List-Id: Discussion list for automake <automake.gnu.org>
- References: <200106272137.f5RLbxm11758@thunder.dstc.qut.edu.au>
I might be wrong, but I believe that what you describe is already in
the current Automake. It might be documented, but at least there is
the macro:
src/am/m4 % less make.m4 nostromo 18:34
# AM_MAKE_INCLUDE()
# -----------------
# Check to see how make treats includes.
AC_DEFUN([AM_MAKE_INCLUDE],
[am_make=${MAKE-make}
cat > confinc << 'END'
doit:
@echo done
END
# If we don't find an include directive, just comment out the code.
AC_MSG_CHECKING([for style of include used by $am_make])
_am_include='#'
_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 | fgrep -v 'ing directory'`" = "don
e"; then
_am_include=include
_am_quote=
_am_result=GNU
fi
# 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
fi
AC_SUBST(_am_include)
AC_SUBST(_am_quote)
AC_MSG_RESULT($_am_result)
rm -f confinc confmf
])