Configure patches -01 and -02 for 5.004_61.
[p5sagit/p5-mst-13.2.git] / makedepend.SH
index 0967253..3c7ffe4 100755 (executable)
@@ -28,6 +28,12 @@ MAKE=$make
 !GROK!THIS!
 $spitshell >>makedepend <<'!NO!SUBS!'
 
+# This script should be called with 
+#     sh ./makedepend MAKE=$(MAKE)
+case "$1" in 
+       MAKE=*) eval $1 ;;
+esac
+
 export PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh \$0; kill \$\$)
 
 case $CONFIG in
@@ -48,7 +54,7 @@ esac
 # cppstdin wrapper script.
 # Put .. and . first so that we pick up the present cppstdin, not
 # an older one lying about in /usr/local/bin.
-PATH=".:..:$PATH"
+PATH=".$path_sep..$path_sep$PATH"
 export PATH
 
 $cat /dev/null >.deptmp
@@ -99,7 +105,7 @@ for file in `$cat .clist`; do
     */*) finc="-I`echo $file | sed 's#/[^/]*$##`" ;;
     *)   finc= ;;
     esac
-    $echo "Finding dependencies for $filebase$obj_ext."
+    $echo "Finding dependencies for $filebase$_o."
     ( $echo "#line 1 \"$file\""; \
       $sed -n <$file \
        -e "/^${filebase}_init(/q" \
@@ -109,9 +115,10 @@ for file in `$cat .clist`; do
        -e 's|\\$||' \
        -e p \
        -e '}' ) >UU/$file.c
-    $cppstdin $finc -I/usr/local/include -I. $cppflags $cppminus <UU/$file.c |
+    $cppstdin $finc -I. $cppflags $cppminus <UU/$file.c |
     $sed \
        -e '/^#.*<stdin>/d' \
+       -e '/^#.*"-"/d' \
        -e 's#\.[0-9][0-9]*\.c#'"$file.c#" \
        -e 's/^[         ]*#[    ]*line/#/' \
        -e '/^# *[0-9][0-9]* *[".\/]/!d' \
@@ -133,6 +140,10 @@ mv .shlist .shlist.old
 $egrep -v '^makedepend\.SH' <.shlist.old >.shlist
 mv .shlist .shlist.old
 $egrep -v '^Makefile\.SH' <.shlist.old >.shlist
+mv .shlist .shlist.old
+$egrep -v '^perl_exp\.SH' <.shlist.old >.shlist
+mv .shlist .shlist.old
+$egrep -v '^config_h\.SH' <.shlist.old >.shlist
 rm .shlist.old
 
 if $test -s .deptmp; then