summaryrefslogtreecommitdiff
path: root/lib/depcomp
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2012-10-18 16:29:21 +0200
committerStefano Lattarini <stefano.lattarini@gmail.com>2012-11-24 15:52:42 +0100
commit3ad09d87325a64e5619268f4afa20a7adb9eeabf (patch)
treec673dc1cf1dd72d89e9aee6dd694eac24ef70678 /lib/depcomp
parent1518257a9328d914d763da188c5fda9a03dba3f2 (diff)
downloadautomake-3ad09d87325a64e5619268f4afa20a7adb9eeabf.tar.gz
depcomp: make some code more self-documenting
* lib/depcomp (make_dummy_makefile): With the help of this function. Use it throughout. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 'lib/depcomp')
-rwxr-xr-xlib/depcomp19
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/depcomp b/lib/depcomp
index adda121d6..0f37d09a3 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
}
@@ -277,10 +283,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"
;;
@@ -485,7 +488,7 @@ hp2)
p
}' "$tmpdepfile" >> "$depfile"
else
- echo "#dummy" > "$depfile"
+ make_dummy_depfile
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;