1 # Generate code to set up dependency tracking. -*- Autoconf -*-
3 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
4 # Free Software Foundation, Inc.
6 # This file is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
12 # _AM_OUTPUT_DEPENDENCY_COMMANDS
13 # ------------------------------
14 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
15 [for mf in $CONFIG_FILES; do
16 # Strip MF so we end up with the name of the file.
17 mf=`echo "$mf" | sed -e 's/:.*$//'`
18 # Check whether this is an Automake generated Makefile or not.
19 # We used to match only the files named `Makefile.in', but
20 # some people rename them; so instead we look at the file content.
21 # Grep'ing the first line is not enough: some people post-process
22 # each Makefile.in and add a new line on top of each file to say so.
23 # Grep'ing the whole file is not good either: AIX grep has a line
24 # limit of 2048, but all sed's we know have understand at least 4000.
25 if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
26 dirpart=`AS_DIRNAME("$mf")`
30 # Extract the definition of DEPDIR, am__include, and am__quote
31 # from the Makefile without running `make'.
32 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
33 test -z "$DEPDIR" && continue
34 am__include=`sed -n 's/^am__include = //p' < "$mf"`
35 test -z "am__include" && continue
36 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
37 # When using ansi2knr, U may be empty or an underscore; expand it
38 U=`sed -n 's/^U = //p' < "$mf"`
39 # Find all dependency output files, they are included files with
40 # $(DEPDIR) in their names. We invoke sed twice because it is the
41 # simplest approach to changing $(DEPDIR) to its actual value in the
44 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
45 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
46 # Make sure the directory exists.
47 test -f "$dirpart/$file" && continue
48 fdir=`AS_DIRNAME(["$file"])`
49 AS_MKDIR_P([$dirpart/$fdir])
50 # echo "creating $dirpart/$file"
51 echo '# dummy' > "$dirpart/$file"
54 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
57 # AM_OUTPUT_DEPENDENCY_COMMANDS
58 # -----------------------------
59 # This macro should only be invoked once -- use via AC_REQUIRE.
61 # This code is only required when automatic dependency tracking
62 # is enabled. FIXME. This creates each `.P' file that we will
63 # need in order to bootstrap the dependency handling code.
64 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
65 [AC_CONFIG_COMMANDS([depfiles],
66 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
67 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])