dnl Generate code to set up dependency tracking. dnl This macro should only be invoked once -- use via AC_REQUIRE. dnl Usage: dnl AM_OUTPUT_DEPENDENCY_COMMANDS dnl dnl This code is only required when automatic dependency tracking dnl is enabled. FIXME. This creates each `.P' file that we will dnl need in order to bootstrap the dependency handling code. AC_DEFUN(AM_OUTPUT_DEPENDENCY_COMMANDS,[ AC_OUTPUT_COMMANDS([ test x"$AMDEP" != x"" || for mf in $CONFIG_FILES; do case "$mf" in Makefile) dirpart=.;; */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;; *) continue;; esac grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # We invoke sed twice because it is the simplest approach to # changing $(DEPDIR) to its actual value in the expansion. for file in `sed -n -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do test -f "$dirpart/$file" && continue echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ], [AMDEP="$AMDEP"])])