summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1996-07-10 23:25:32 +0000
committerCharles Bailey <bailey@genetics.upenn.edu>1996-07-10 23:25:32 +0000
commit1e2cbf11d82d7090853f20fda94f2d57b874987c (patch)
tree66d4784f5b836c767178403385b6fe92978fce65
parent63eb108b0a1e0a9928bf7d5d48434a5e376da2aa (diff)
downloadperl-1e2cbf11d82d7090853f20fda94f2d57b874987c.tar.gz
perl 5.003_01: makedepend.SH
Allow for different shell names Delete old version of file before copying in new version
-rwxr-xr-xmakedepend.SH10
1 files changed, 8 insertions, 2 deletions
diff --git a/makedepend.SH b/makedepend.SH
index acd9d7ecef..931dd82655 100755
--- a/makedepend.SH
+++ b/makedepend.SH
@@ -1,3 +1,4 @@
+#! /bin/sh
case $CONFIG in
'')
if test -f config.sh; then TOP=.;
@@ -16,6 +17,9 @@ esac
case "$0" in
*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
esac
+
+: ${bin_sh=/bin/sh}
+
echo "Extracting makedepend (with variable substitutions)"
rm -f makedepend
$spitshell >makedepend <<!GROK!THIS!
@@ -53,6 +57,7 @@ export PATH
$cat /dev/null >.deptmp
$rm -f *.c.c c/*.c.c
if test -f Makefile; then
+ rm -f $firstmakefile
cp Makefile $firstmakefile
fi
mf=$firstmakefile
@@ -128,7 +133,7 @@ rm .shlist.old
if $test -s .deptmp; then
for file in `cat .shlist`; do
$echo `$expr X$file : 'X\(.*\).SH'`: $file $TOP/config.sh \; \
- /bin/sh $file >> .deptmp
+ $bin_sh $file >> .deptmp
done
$echo "Updating $mf..."
$echo "# If this runs make out of memory, delete /usr/include lines." \
@@ -155,11 +160,12 @@ else
$sed -f .hsed >> $mf.new
for file in `$cat .shlist`; do
$echo `$expr X$file : 'X\(.*\).SH'`: $file $TOP/config.sh \; \
- /bin/sh $file >> $mf.new
+ $bin_sh $file >> $mf.new
done
fi
$rm -f $mf.old
$cp $mf $mf.old
+$rm -f $mf
$cp $mf.new $mf
$rm $mf.new
$echo "# WARNING: Put nothing here or make depend will gobble it up!" >> $mf