Alexandre Oliva writes:
 > If the extra newline will be in the actual output, it will break some
 > stupid `make's that will go nuts if they find an empty line after a
 > backslash.
 > 

I didn't know about that :) Here's a new version of depcomp patch that
avoids it.

Alex.

Index: depcomp
===================================================================
RCS file: /cvs/automake/automake/depcomp,v
retrieving revision 1.7
diff -u -r1.7 depcomp
--- depcomp     2000/06/02 23:27:02     1.7
+++ depcomp     2000/06/26 10:06:26
@@ -250,7 +250,8 @@
       ;;
     esac
     "$@" -E |
-    sed -n '/^# [0-9][0-9]* "\([^"]*\)"/ s::'"$object"'\: \1:p' > "$tmpdepfile"
+    sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+    sed '$ s: \\$::' > "$tmpdepfile"
   ) &
   proc=$!
   "$@"
@@ -258,8 +259,9 @@
   wait "$proc"
   if test "$stat" != 0; then exit $stat; fi
   rm -f "$depfile"
-  cat < "$tmpdepfile" > "$depfile"
-  sed < "$tmpdepfile" -e 's/^[^:]*: //' -e 's/$/ :/' >> "$depfile"
+  echo "$object : \\" > "$depfile"
+  cat < "$tmpdepfile" >> "$depfile"
+  sed < "$tmpdepfile" -e '/^$/d' -e 's/^ //' -e 's/ \\$//' -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 

Reply via email to