automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC 11/20] depcomp: make some code more self-documenting


From: Stefano Lattarini
Subject: [RFC 11/20] depcomp: make some code more self-documenting
Date: Thu, 18 Oct 2012 22:40:45 +0200

* lib/depcomp (make_dummy_makefile): With the help of this function.
Use it throughout.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 lib/depcomp | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/lib/depcomp b/lib/depcomp
index f1ba7e5..74e17c2 100755
--- a/lib/depcomp
+++ b/lib/depcomp
@@ -74,6 +74,14 @@ set_base_from ()
   base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
 }
 
+# If no dependency file was actually created by the compiler invocation,
+# we still have to create a dummy depfile, to avoid errors with the
+# Makefile "include basename.Plo" scheme.
+make_dummy_depfile ()
+{
+  echo "#dummy" > "$depfile"
+}
+
 # Factor out some common post-processing of the generated depfile.
 # Requires the auxiliary global variable '$tmpdepfile' to be set.
 aix_post_process_depfile ()
@@ -92,9 +100,7 @@ aix_post_process_depfile ()
     } > "$depfile"
     rm -f "$tmpdepfile"
   else
-    # No dependency file was actually created by the compiler invocation.
-    # No real dependency information will be available.
-    echo "#dummy" > "$depfile"
+    make_dummy_depfile
   fi
 }
 
@@ -270,10 +276,7 @@ sgi)
    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
    >> "$depfile"
   else
-    # The sourcefile does not contain any dependencies, so just
-    # store a dummy comment line, to avoid errors with the Makefile
-    # "include basename.Plo" scheme.
-    echo "#dummy" > "$depfile"
+    make_dummy_depfile
   fi
   rm -f "$tmpdepfile"
   ;;
@@ -478,7 +481,7 @@ hp2)
               p
             }' "$tmpdepfile" >> "$depfile"
   else
-    echo "#dummy" > "$depfile"
+    make_dummy_depfile
   fi
   rm -f "$tmpdepfile" "$tmpdepfile2"
   ;;
-- 
1.8.0.rc2.11.gd25c58c




reply via email to

[Prev in Thread] Current Thread [Next in Thread]