This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Oops. Fix threaded builds.
[perl5.git] / makedepend.SH
index 4bfb325..f992af3 100755 (executable)
@@ -39,7 +39,7 @@ mkdir .depending
 # This script should be called with 
 #     sh ./makedepend MAKE=$(MAKE)
 case "$1" in 
-       MAKE=*) eval $1 ;;
+       MAKE=*) eval $1; shift ;;
 esac
 
 export PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh \$0; kill \$\$)
@@ -153,11 +153,11 @@ for file in `$cat .clist`; do
     ( $echo "#line 2 \"$file\""; \
       $sed -n <$file \
        -e "/^${filebase}_init(/q" \
-        -e ': testcontinuation'       \
+        -e ': testcont'               \
        -e '/^[  ]*#/s|/\*.*\*/||'    \
         -e '/\\$/{'                   \
             -e 'N'                    \
-            -e 'b testcontinuation'   \
+            -e 'b testcont'           \
         -e '}'                        \
         -e 's/\\\n/ /g'               \
        -e '/^#line/d' \
@@ -206,35 +206,12 @@ for file in `$cat .clist`; do
            -e 's|\.c\.c|.c|' $uwinfix .cout .cerr| \
         $uniq | $sort | $uniq >> .deptmp
     fi
-    echo "$filebase\$(OBJ_EXT): cflags" >> .deptmp
+    echo "$filebase\$(OBJ_EXT): $@" >> .deptmp
 done
 
 $sed <$mf >$mf.new -e '1,/^# AUTOMATICALLY/!d'
 
-$MAKE shlist || ($echo "Searching for .SH files..."; \
-       $echo *.SH | $tr ' ' $trnl | $egrep -v '\*' >.shlist)
-
-# Now extract the dependencies on makedepend.SH and Makefile.SH
-# (they should reside in the main Makefile):
-rm -f .shlist.old
-mv .shlist .shlist.old
-$egrep -v '^makedepend\.SH' <.shlist.old >.shlist
-rm -f .shlist.old
-mv .shlist .shlist.old
-$egrep -v '^Makefile\.SH' <.shlist.old >.shlist
-rm -f .shlist.old
-mv .shlist .shlist.old
-$egrep -v '^perl_exp\.SH' <.shlist.old >.shlist
-rm -f .shlist.old
-mv .shlist .shlist.old
-$egrep -v '^config_h\.SH' <.shlist.old >.shlist
-rm .shlist.old
-
 if $test -s .deptmp; then
-    for file in `cat .shlist`; do
-       $echo `$expr X$file : 'X\(.*\).SH'`: $file $TOP/config.sh \; \
-           $sh $file >> .deptmp
-    done
     $echo "Updating $mf..."
     $echo "# If this runs make out of memory, delete /usr/include lines." \
        >> $mf.new
@@ -262,10 +239,6 @@ else
        $sed -f .hsed >> $mf.new
     <.deptmp $sed -n 's|h:#include "\(.*\)".*$|h: \1|p' | \
        $sed -f .hsed >> $mf.new
-    for file in `$cat .shlist`; do
-       $echo `$expr X$file : 'X\(.*\).SH'`: $file $TOP/config.sh \; \
-           $sh $file >> $mf.new
-    done
 fi
 $rm -f $mf.old
 $cp $mf $mf.old
@@ -273,15 +246,9 @@ $rm -f $mf
 $cp $mf.new $mf
 $rm $mf.new
 $echo "# WARNING: Put nothing here or make depend will gobble it up!" >> $mf
-$rm -rf .deptmp UU .shlist .clist .hlist .hsed .cout .cerr
+$rm -rf .deptmp UU .clist .hlist .hsed .cout .cerr
 rmdir .depending
 
 !NO!SUBS!
 $eunicefix makedepend
 chmod +x makedepend
-case `pwd` in
-*SH)
-    $rm -f ../makedepend
-    ln makedepend ../makedepend
-    ;;
-esac