translate: few more ops and corner cases
[ia32rtools.git] / run_mkpubinc.sh
CommitLineData
feb96a61 1#!/bin/sh
8022df01 2set -e
feb96a61 3
beb04e26 4echo -n > $1
feb96a61 5
beb04e26 6cat $2 | fromdos | sed -e \
7'1,/^_rdata.*segment/d;/^_data.*\<ends\>/q;/^[[:blank:];]/d;/^;/d;/^_r\?data\>/d;' | awk '{print $1}' | \
feb96a61 8while read a; do
9 test -z "$a" && continue
7b64f7cd 10 case $a in
11 __IMPORT_DESCRIPTOR*)
12 continue
13 ;;
beb04e26 14 _data)
15 continue
16 ;;
7b64f7cd 17 *)
18 ;;
19 esac
20
beb04e26 21 echo "_$a equ $a" >> $1
22 echo "PUBLIC _$a" >> $1
368deb23 23done
24
beb04e26 25if test -n "$3"; then
26 echo "; funcs called from C" >> $1
368deb23 27
beb04e26 28 cat $3 | \
29 while read a; do
30# echo "_$a equ $a" >> $1
31# echo "PUBLIC _$a" >> $1
32 a=`echo $a | awk -F@ '{print $1}'`
33 echo "PUBLIC $a" >> $1
34 done
35fi