"make dist" did not depend on $(BUILT_SOURCES)
[automake.git] / m4 / depout.m4
blob204d479895a978993d95210e4ac004b067599af6
1 # Generate code to set up dependency tracking.              -*- Autoconf -*-
3 # Copyright (C) 1999-2017 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 # _AM_OUTPUT_DEPENDENCY_COMMANDS
10 # ------------------------------
11 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
13   # Older Autoconf quotes --file arguments for eval, but not when files
14   # are listed without --file.  Let's play safe and only enable the eval
15   # if we detect the quoting.
16   # TODO: see whether this extra hack can be removed once we start
17   # requiring Autoconf 2.70 or later.
18   AS_CASE([$CONFIG_FILES],
19           [*\'*], [eval set x "$CONFIG_FILES"],
20           [*], [set x $CONFIG_FILES])
21   shift
22   # Used to flag and report bootstrapping failures.
23   am_rc=0
24   for am_mf
25   do
26     # Strip MF so we end up with the name of the file.
27     am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
28     # Check whether this is an Automake generated Makefile which includes
29     # dependency-tracking related rules and includes.
30     # Grep'ing the whole file directly is not great: AIX grep has a line
31     # limit of 2048, but all sed's we know have understand at least 4000.
32     sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
33       || continue
34     am_dirpart=`AS_DIRNAME(["$am_mf"])`
35     am_filepart=`AS_BASENAME(["$am_mf"])`
36     AM_RUN_LOG([cd "$am_dirpart" \
37       && sed -e '/# am--include-marker/d' "$am_filepart" \
38         | $MAKE -f - am--depfiles]) || am_rc=$?
39   done
40   if test $am_rc -ne 0; then
41     AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
42     for automatic dependency tracking.  Try re-running configure with the
43     '--disable-dependency-tracking' option to at least be able to build
44     the package (albeit without support for automatic dependency tracking).])
45   fi
46   AS_UNSET([am_dirpart])
47   AS_UNSET([am_filepart])
48   AS_UNSET([am_mf])
49   AS_UNSET([am_rc])
50   rm -f conftest-deps.mk
52 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
55 # AM_OUTPUT_DEPENDENCY_COMMANDS
56 # -----------------------------
57 # This macro should only be invoked once -- use via AC_REQUIRE.
59 # This code is only required when automatic dependency tracking is enabled.
60 # This creates each '.Po' and '.Plo' makefile fragment that we'll need in
61 # order to bootstrap the dependency handling code.
62 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
63 [AC_CONFIG_COMMANDS([depfiles],
64      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
65      [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])