cmplib
801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh
#
# script to compare library in asm level
#
# cmplib [file1] [file2]
#
if test $# -gt 1
then
FILE1=$1;FILE2=$2
else
echo "cmplib [file1] [file2]" ; exit 1
fi
if test ! -r $FILE1 ;then
echo $FILE1 is maybe non-exist ; exit 0 ; fi
if test ! -r $FILE2 ;then
echo $FILE2 is maybe non-exist ; exit 0 ; fi
OBJS=`ar t $FILE1`
ar x $FILE1
for OBJ in $OBJS ; do gdis $OBJ >$OBJ.tmp1 ;done
OBJS=`ar t $FILE2`
ar x $FILE2
for OBJ in $OBJS ; do gdis $OBJ >$OBJ.tmp2 ;done
for OBJ in $OBJS
do
if test "`diff $OBJ.tmp1 $OBJ.tmp2`" ;then
echo " $OBJ \t:unmatch!"
diff $OBJ.tmp1 $OBJ.tmp2 > lastdiff.error
exit 0
else
echo " $OBJ \t:match"
rm -f $OBJ.tmp1 $OBJ.tmp2 $OBJ
fi
done
echo "conglatulations! v(^_^)v"