]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* m4/depout.m4: Instead of `find'ing Makefiles, just iterate on
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Mon, 31 May 1999 22:52:58 +0000 (22:52 +0000)
committerAlexandre Oliva <oliva@dcc.unicamp.br>
Mon, 31 May 1999 22:52:58 +0000 (22:52 +0000)
CONFIG_FILES.  Do not use temporary variable for list of
dependency files, it breaks Cygwin.

ChangeLog
m4/depout.m4

index 2d5ad82d7058323087666d1198e742571bc09a73..8cf77633e0217deed62e528b04251c2f535e7659 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+1999-06-01  Alexandre Oliva  <oliva@dcc.unicamp.br>
+
+       * m4/depout.m4: Instead of `find'ing Makefiles, just iterate on
+       CONFIG_FILES.  Do not use temporary variable for list of
+       dependency files, it breaks Cygwin.
+
 1999-04-27  Alexandre Oliva  <oliva@dcc.unicamp.br>
 
        * depcomp (gcc): Imported comments removed from depend2.am, so
index 72d65df9c375d8fe28da6a23ace6ea36eaafe3ea..322ce757ed759c10208199947d27958ec5143d81 100644 (file)
@@ -9,13 +9,23 @@ 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([
-find . -name Makefile -print | while read mf; do
+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`
+  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.
-  deps="`sed -n -e '
+  for file in `sed -n -e '
     /^DEP_FILES = .*\\\\$/ {
       s/^DEP_FILES = //
       :loop
@@ -25,23 +35,11 @@ find . -name Makefile -print | while read mf; do
        /\\\\$/ b loop
       p
     }
-    /^DEP_FILES = / s/^DEP_FILES = //p' $mf | \
-       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`"
-  # If we found a definition, proceed to create all the files.
-  if test -n "$deps"; then
-    dirpart="`echo $mf | sed -e 's|/[^/]*$||'`"
-    test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
-    case "$deps" in
-    *'$U'*) # When using ansi2knr, U may be empty or an underscore; expand it
-       U=`sed -n -e '/^U = / s///p' $mf`
-       deps=`echo "$deps" | sed 's/\$U/'"$U"'/g'`
-       ;;
-    esac       
-    for file in $deps; do
-      if test ! -f "$dirpart/$file"; then
-       echo "creating $dirpart/$file"
-       echo '# dummy' > "$dirpart/$file"
-      fi
-    done
-  fi
-done])])
+    /^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
+])])