translate: avoid dupe work
[ia32rtools.git] / run_mkpubinc.sh
... / ...
CommitLineData
1#!/bin/sh
2set -e
3
4echo -n > $1
5
6cat $2 | fromdos | sed -e \
7'1,/^_rdata.*segment/d;/^_data.*\<ends\>/q;/^[[:blank:];]/d;/^;/d;/^_r\?data\>/d;' | awk '{print $1}' | \
8while read a; do
9 test -z "$a" && continue
10 case $a in
11 __IMPORT_DESCRIPTOR*)
12 continue
13 ;;
14 _data)
15 continue
16 ;;
17 *)
18 ;;
19 esac
20
21 echo "_$a equ $a" >> $1
22 echo "PUBLIC _$a" >> $1
23done
24
25if test -n "$3"; then
26 echo "; funcs called from C" >> $1
27
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