From: notaz Date: Fri, 31 Jan 2014 00:43:07 +0000 (+0200) Subject: adjust scripts for reuse X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=beb04e26b3ba6208551d98ce78689464bb1100a4;p=ia32rtools.git adjust scripts for reuse --- diff --git a/run_imp.sh b/run_imp.sh index 1c9cf90..c1df2d1 100755 --- a/run_imp.sh +++ b/run_imp.sh @@ -7,7 +7,7 @@ echo ".data" > $2 echo ".align 4" >> $2 cat $2_implist | while read i; do - rm -f tmpsym + rm -f $2_tmpsym case $i in __imp_*) si=`echo $i | cut -c 7-` @@ -21,11 +21,11 @@ cat $2_implist | while read i; do while read f; do sym=`i586-mingw32msvc-nm $f | grep "\<_$si\>" | grep ' T ' | awk '{print $3}'` if test -n "$sym"; then - echo $sym > tmpsym + echo $sym > $2_tmpsym break fi done - sym=`cat tmpsym` + sym=`cat $2_tmpsym` if test -z "$sym"; then echo "no file/sym for $i, lf $f" exit 1 diff --git a/run_mkimpinc.sh b/run_mkimpinc.sh index 6faa018..0f5548a 100755 --- a/run_mkimpinc.sh +++ b/run_mkimpinc.sh @@ -1,33 +1,35 @@ #!/bin/sh set -e -echo -n > $3 +echo -n > $1 -cat $1 | \ +cat $2 | \ while read a; do a_no_at=`echo $a | awk -F@ '{printf $1}'` - #echo "$a_no_at equ _$a" >> $3 - #echo "EXTRN _$a:PROC" >> $3 - echo "EXTRN $a:PROC" >> $3 + #echo "$a_no_at equ _$a" >> $1 + #echo "EXTRN _$a:PROC" >> $1 + echo "EXTRN $a:PROC" >> $1 done -echo "; '_' funcs" >> $3 +if test -n "$3"; then + echo "; '_' funcs" >> $1 -cat $2 | \ -while read a; do - case $a in - \#*) - continue - ;; - \;*) - continue - ;; - "") - continue - ;; - *) - ;; - esac + cat $3 | \ + while read a; do + case $a in + \#*) + continue + ;; + \;*) + continue + ;; + "") + continue + ;; + *) + ;; + esac - echo "EXTRN $a:PROC" >> $3 -done + echo "EXTRN $a:PROC" >> $1 + done +fi diff --git a/run_mkpubinc.sh b/run_mkpubinc.sh index 8d6afe8..dc016c9 100755 --- a/run_mkpubinc.sh +++ b/run_mkpubinc.sh @@ -1,30 +1,35 @@ #!/bin/sh set -e -echo -n > $3 +echo -n > $1 -cat $1 | fromdos | sed -e \ -'1,/^_rdata.*segment/d;/^_data_last/q;/^[[:blank:];]/d;/^;/d;/^_r\?data\>/d;' | awk '{print $1}' | \ +cat $2 | fromdos | sed -e \ +'1,/^_rdata.*segment/d;/^_data.*\/q;/^[[:blank:];]/d;/^;/d;/^_r\?data\>/d;' | awk '{print $1}' | \ while read a; do test -z "$a" && continue case $a in __IMPORT_DESCRIPTOR*) continue ;; + _data) + continue + ;; *) ;; esac - echo "_$a equ $a" >> $3 - echo "PUBLIC _$a" >> $3 + echo "_$a equ $a" >> $1 + echo "PUBLIC _$a" >> $1 done -echo "; funcs called from C" >> $3 +if test -n "$3"; then + echo "; funcs called from C" >> $1 -cat $2 | \ -while read a; do -# echo "_$a equ $a" >> $3 -# echo "PUBLIC _$a" >> $3 - a=`echo $a | awk -F@ '{print $1}'` - echo "PUBLIC $a" >> $3 -done + cat $3 | \ + while read a; do +# echo "_$a equ $a" >> $1 +# echo "PUBLIC _$a" >> $1 + a=`echo $a | awk -F@ '{print $1}'` + echo "PUBLIC $a" >> $1 + done +fi