| 1 | #!/bin/sh |
| 2 | set -e |
| 3 | |
| 4 | echo -n > $1 |
| 5 | |
| 6 | cat $2 | fromdos | sed -e \ |
| 7 | '1,/^_rdata.*segment/d;/^_data.*\<ends\>/q;/^[[:blank:];]/d;/^;/d;/^_r\?data\>/d;' | awk '{print $1}' | \ |
| 8 | while 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 |
| 23 | done |
| 24 | |
| 25 | if 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 |
| 35 | fi |