summaryrefslogtreecommitdiffstats
path: root/usr.bin/mkdep
diff options
context:
space:
mode:
authorwosch <wosch@FreeBSD.org>1996-10-27 15:53:18 +0000
committerwosch <wosch@FreeBSD.org>1996-10-27 15:53:18 +0000
commitca69b8577451476c6ef52feaa49721e07248dbee (patch)
tree8adf90c96fe000059c12c96b8af333659cb794d5 /usr.bin/mkdep
parentd7ad38d757c638be68a0aa414226f3564ad6e4fa (diff)
downloadFreeBSD-src-ca69b8577451476c6ef52feaa49721e07248dbee.zip
FreeBSD-src-ca69b8577451476c6ef52feaa49721e07248dbee.tar.gz
$@ -> "$@", now ``mkdep "foo bar".c'' works.
Do not exit with status 0 if mkdep(1) cannot create output, e.g. if .depend is not writable or the FS is readonly mounted. Store arguments as comments for debugging purpose.
Diffstat (limited to 'usr.bin/mkdep')
-rw-r--r--usr.bin/mkdep/mkdep.gcc.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.bin/mkdep/mkdep.gcc.sh b/usr.bin/mkdep/mkdep.gcc.sh
index 18cee35..857691e 100644
--- a/usr.bin/mkdep/mkdep.gcc.sh
+++ b/usr.bin/mkdep/mkdep.gcc.sh
@@ -32,7 +32,7 @@
# SUCH DAMAGE.
#
# @(#)mkdep.gcc.sh 8.1 (Berkeley) 6/6/93
-#
+# $Id$
PATH=/bin:/usr/bin; export PATH
@@ -69,16 +69,18 @@ esac
TMP=/tmp/mkdep$$
trap 'rm -f $TMP ; exit 1' 1 2 3 13 15
+trap 'rm -f $TMP' 0
# For C sources, mkdep must use exactly the same cpp and predefined flags
# as the compiler would. This is easily arranged by letting the compiler
# pick the cpp. mkdep must be told the cpp to use for exceptional cases.
MKDEP_CPP=${MKDEP_CPP-"cc -E"}
-if $MKDEP_CPP -M $@ > $TMP; then :
+echo "# $@" > $TMP # store arguments for debugging
+
+if $MKDEP_CPP -M "$@" >> $TMP; then :
else
echo 'mkdep: compile failed.'
- rm -f $TMP
exit 1
fi
@@ -95,5 +97,4 @@ case x$pflag in
;;
esac
-rm -f $TMP
-exit 0
+exit $?
OpenPOWER on IntegriCloud