1 # Generate code to set up dependency tracking. -*- Autoconf -*-
3 # Copyright (C) 1999-2012 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.
10 # _AM_OUTPUT_DEPENDENCY_COMMANDS
11 # ------------------------------
12 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
14 # Older Autoconf quotes --file arguments for eval, but not when files
15 # are listed without --file. Let's play safe and only enable the eval
16 # if we detect the quoting.
18 *\'*) eval set x "$CONFIG_FILES" ;;
19 *) set x $CONFIG_FILES ;;
24 # Strip MF so we end up with the name of the file.
25 mf=`echo "$mf" | sed -e 's/:.*$//'`
26 # Check whether this is an Automake generated Makefile or not.
27 # We used to match only the files named 'Makefile.in', but
28 # some people rename them; so instead we look at the file content.
29 # Grep'ing the first line is not enough: some people post-process
30 # each Makefile.in and add a new line on top of each file to say so.
31 # Grep'ing the whole file is not good either: AIX grep has a line
32 # limit of 2048, but all sed's we know have understand at least 4000.
33 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
34 dirpart=`AS_DIRNAME("$mf")`
38 # Extract the definition of DEPDIR, am__include, and am__quote
39 # from the Makefile without running 'make'.
40 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
41 test -z "$DEPDIR" && continue
42 am__include=`sed -n 's/^am__include = //p' < "$mf"`
43 test -z "am__include" && continue
44 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
45 # Find all dependency output files, they are included files with
46 # $(DEPDIR) in their names. We invoke sed twice because it is the
47 # simplest approach to changing $(DEPDIR) to its actual value in the
50 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
51 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
52 # Make sure the directory exists.
53 test -f "$dirpart/$file" && continue
54 fdir=`AS_DIRNAME(["$file"])`
55 AS_MKDIR_P([$dirpart/$fdir])
56 # echo "creating $dirpart/$file"
57 echo '# dummy' > "$dirpart/$file"
61 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
64 # AM_OUTPUT_DEPENDENCY_COMMANDS
65 # -----------------------------
66 # This macro should only be invoked once -- use via AC_REQUIRE.
68 # This code is only required when automatic dependency tracking
69 # is enabled. FIXME. This creates each '.P' file that we will
70 # need in order to bootstrap the dependency handling code.
71 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
72 [AC_CONFIG_COMMANDS([depfiles],
73 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
74 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])