[Top][All Lists]
[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
- [RFC 03/20] depcomp: use "rmdir", not "rm -rf", to remove the empty lock directory, (continued)
- [RFC 03/20] depcomp: use "rmdir", not "rm -rf", to remove the empty lock directory, Stefano Lattarini, 2012/10/18
- [RFC 04/20] depcomp: correctly propagate exit status in exit trap, Stefano Lattarini, 2012/10/18
- [RFC 05/20] depcomp: safer quoting in variable expansion, Stefano Lattarini, 2012/10/18
- [RFC 06/20] depcomp: cosmetic fixlets to a comment, Stefano Lattarini, 2012/10/18
- [RFC 07/20] depcomp: don't rely on character ranges working as in C locale, Stefano Lattarini, 2012/10/18
- [RFC 08/20] depcomp: reduce code duplication, Stefano Lattarini, 2012/10/18
- [RFC 09/20] depcomp: avoid an extra fork when possible, Stefano Lattarini, 2012/10/18
- [RFC 10/20] depcomp: less duplication between AIX and Tru64 modes, Stefano Lattarini, 2012/10/18
- [RFC 11/20] depcomp: make some code more self-documenting,
Stefano Lattarini <=
- [RFC 12/20] depcomp: shell code style changes, Stefano Lattarini, 2012/10/18
- [RFC 15/20] depcomp: remove an unused variable, Stefano Lattarini, 2012/10/18
- [RFC 14/20] depcomp: rewrite a sed invocation for less quoting, Stefano Lattarini, 2012/10/18
- [RFC 13/20] depcomp: whitespace fixes, Stefano Lattarini, 2012/10/18
- [RFC 17/20] depcomp: improve comments about tcc support, Stefano Lattarini, 2012/10/18
- [RFC 18/20] tests: fix spurious failures with tcc, Stefano Lattarini, 2012/10/18
- [RFC 16/20] depcomp: remove last relics of libtool 1.4 support, Stefano Lattarini, 2012/10/18
- [RFC 19/20] NEWS: update w.r.t. recent depcomp changes, Stefano Lattarini, 2012/10/18
- [RFC 20/20] depcomp: remove 'icc' depmode, add 'tcc' one, Stefano Lattarini, 2012/10/18