Use PERL=../miniperl
[p5sagit/p5-mst-13.2.git] / os2 / diff.mkdep
1 *** makedepend.SH.orig  Wed Aug 30 19:55:44 1995
2 --- makedepend.SH       Sun Nov 26 14:59:34 1995
3 ***************
4 *** 53,69 ****
5   $cat /dev/null >.deptmp
6   $rm -f *.c.c c/*.c.c
7   if test -f Makefile; then
8 !     cp Makefile makefile
9   fi
10 ! mf=makefile
11   if test -f $mf; then
12       defrule=`<$mf sed -n              \
13 !       -e '/^\.c\.o:.*;/{'             \
14         -e    's/\$\*\.c//'             \
15         -e    's/^[^;]*;[        ]*//p' \
16         -e    q                         \
17         -e '}'                          \
18 !       -e '/^\.c\.o: *$/{'             \
19         -e    N                         \
20         -e    's/\$\*\.c//'             \
21         -e    's/^.*\n[  ]*//p'         \
22 --- 53,69 ----
23   $cat /dev/null >.deptmp
24   $rm -f *.c.c c/*.c.c
25   if test -f Makefile; then
26 !     cp Makefile $firstmakefile
27   fi
28 ! mf=$firstmakefile
29   if test -f $mf; then
30       defrule=`<$mf sed -n              \
31 !       -e '/^\.c\(\$(OBJ_EXT)\|\.o\):.*;/{'    \
32         -e    's/\$\*\.c//'             \
33         -e    's/^[^;]*;[        ]*//p' \
34         -e    q                         \
35         -e '}'                          \
36 !       -e '/^\.c\(\$(OBJ_EXT)\|\.o\): *$/{'    \
37         -e    N                         \
38         -e    's/\$\*\.c//'             \
39         -e    's/^.*\n[  ]*//p'         \
40 ***************
41 *** 91,97 ****
42       */*) finc="-I`echo $file | sed 's#/[^/]*$##`" ;;
43       *)   finc= ;;
44       esac
45 !     $echo "Finding dependencies for $filebase.o."
46       ( $echo "#line 1 \"$file\""; \
47         $sed -n <$file \
48         -e "/^${filebase}_init(/q" \
49 --- 91,97 ----
50       */*) finc="-I`echo $file | sed 's#/[^/]*$##`" ;;
51       *)   finc= ;;
52       esac
53 !     $echo "Finding dependencies for $filebase$obj_ext."
54       ( $echo "#line 1 \"$file\""; \
55         $sed -n <$file \
56         -e "/^${filebase}_init(/q" \
57 ***************
58 *** 107,114 ****
59         -e 's#\.[0-9][0-9]*\.c#'"$file.c#" \
60         -e 's/^[         ]*#[    ]*line/#/' \
61         -e '/^# *[0-9][0-9]* *[".\/]/!d' \
62 !       -e 's/^.*"\(.*\)".*$/'$filebase'.o: \1/' \
63 !       -e 's/^# *[0-9][0-9]* \(.*\)$/'$filebase'.o: \1/' \
64         -e 's|: \./|: |' \
65         -e 's|\.c\.c|.c|' | \
66       $uniq | $sort | $uniq >> .deptmp
67 --- 107,114 ----
68         -e 's#\.[0-9][0-9]*\.c#'"$file.c#" \
69         -e 's/^[         ]*#[    ]*line/#/' \
70         -e '/^# *[0-9][0-9]* *[".\/]/!d' \
71 !       -e 's/^.*"\(.*\)".*$/'$filebase'\$(OBJ_EXT): \1/' \
72 !       -e 's/^# *[0-9][0-9]* \(.*\)$/'$filebase'\$(OBJ_EXT): \1/' \
73         -e 's|: \./|: |' \
74         -e 's|\.c\.c|.c|' | \
75       $uniq | $sort | $uniq >> .deptmp
76 ***************
77 *** 118,123 ****
78 --- 118,130 ----
79   
80   $MAKE shlist || ($echo "Searching for .SH files..."; \
81         $echo *.SH | $tr ' ' '\012' | $egrep -v '\*' >.shlist)
82
83 + # Now extract the dependency on makedepend.SH
84 + # (it should reside in the main Makefile):
85 + mv .shlist .shlist.old
86 + $egrep -v '^makedepend\.SH' <.shlist.old >.shlist
87 + rm .shlist.old
88
89   if $test -s .deptmp; then
90       for file in `cat .shlist`; do
91         $echo `$expr X$file : 'X\(.*\).SH'`: $file $TOP/config.sh \; \
92 ***************
93 *** 126,132 ****
94       $echo "Updating $mf..."
95       $echo "# If this runs make out of memory, delete /usr/include lines." \
96         >> $mf.new
97 !     $sed 's|^\(.*\.o:\) *\(.*/.*\.c\) *$|\1 \2; '"$defrule \2|" .deptmp \
98          >>$mf.new
99   else
100       $MAKE hlist || ($echo "Searching for .h files..."; \
101 --- 133,139 ----
102       $echo "Updating $mf..."
103       $echo "# If this runs make out of memory, delete /usr/include lines." \
104         >> $mf.new
105 !     $sed 's|^\(.*\(\$(OBJ_EXT)\|\.o\):\) *\(.*/.*\.c\) *$|\1 \3; '"$defrule \2|" .deptmp \
106          >>$mf.new
107   else
108       $MAKE hlist || ($echo "Searching for .h files..."; \
109 ***************
110 *** 136,145 ****
111       $echo "Updating $mf..."
112       <.clist $sed -n                                                   \
113         -e '/\//{'                                                      \
114 !       -e   's|^\(.*\)/\(.*\)\.c|\2.o: \1/\2.c; '"$defrule \1/\2.c|p"  \
115         -e   d                                                          \
116         -e '}'                                                          \
117 !       -e 's|^\(.*\)\.c|\1.o: \1.c|p' >> $mf.new
118       <.hlist $sed -n 's|\(.*/\)\(.*\)|s= \2= \1\2=|p' >.hsed
119       <.deptmp $sed -n 's|c:#include "\(.*\)".*$|o: \1|p' | \
120          $sed 's|^[^;]*/||' | \
121 --- 143,152 ----
122       $echo "Updating $mf..."
123       <.clist $sed -n                                                   \
124         -e '/\//{'                                                      \
125 !       -e   's|^\(.*\)/\(.*\)\.c|\2\$(OBJ_EXT): \1/\2.c; '"$defrule \1/\2.c|p" \
126         -e   d                                                          \
127         -e '}'                                                          \
128 !       -e 's|^\(.*\)\.c|\1\$(OBJ_EXT): \1.c|p' >> $mf.new
129       <.hlist $sed -n 's|\(.*/\)\(.*\)|s= \2= \1\2=|p' >.hsed
130       <.deptmp $sed -n 's|c:#include "\(.*\)".*$|o: \1|p' | \
131          $sed 's|^[^;]*/||' | \