1 dnl Generate code to set up dependency tracking.
2 dnl This macro should only be invoked once -- use via AC_REQUIRE.
4 dnl AM_OUTPUT_DEPENDENCY_COMMANDS
7 dnl This code is only required when automatic dependency tracking
8 dnl is enabled. FIXME. This creates each `.P' file that we will
9 dnl need in order to bootstrap the dependency handling code.
10 AC_DEFUN(AM_OUTPUT_DEPENDENCY_COMMANDS,[
12 test x"$AMDEP" != x"" ||
13 for mf in $CONFIG_FILES; do
16 */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
19 grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
20 # Extract the definition of DEP_FILES from the Makefile without
22 DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
23 test -z "$DEPDIR" && continue
24 # When using ansi2knr, U may be empty or an underscore; expand it
25 U=`sed -n -e '/^U = / s///p' < "$mf"`
26 test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
27 # We invoke sed twice because it is the simplest approach to
28 # changing $(DEPDIR) to its actual value in the expansion.
29 for file in `sed -n -e '
30 /^DEP_FILES = .*\\\\$/ {
39 /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
40 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
41 # Make sure the directory exists.
42 test -f "$dirpart/$file" && continue
43 fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
44 $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
45 # echo "creating $dirpart/$file"
46 echo '# dummy' > "$dirpart/$file"
50 ac_aux_dir="$ac_aux_dir"])])