makedef: Fold as much text transformations as possible into the initial dump
authorMartin Storsjö <martin@martin.st>
Thu, 24 Aug 2017 20:04:38 +0000 (23:04 +0300)
committerMartin Storsjö <martin@martin.st>
Thu, 31 Aug 2017 11:22:15 +0000 (14:22 +0300)
This avoids redoing them for each expression in the list.

Signed-off-by: Martin Storsjö <martin@martin.st>
compat/windows/makedef

index fcaf108..b3de992 100755 (executable)
@@ -112,7 +112,10 @@ for line in $(cat ${vscript} | tr '\t' ' '); do
 '
 done
 
-dump=$(dumpbin -linkermember:1 ${libname})
+dump=$(dumpbin -linkermember:1 ${libname} |
+          sed -e '/public symbols/,$!d' -e '/^ \{1,\}Summary/,$d' -e "s/ \{1,\}${prefix}/ /" -e 's/ \{1,\}/ /g' |
+          tail -n +2 |
+          cut -d' ' -f3)
 
 rm ${libname}
 
@@ -121,9 +124,6 @@ list=""
 for exp in ${regex}; do
     list="${list}"'
 '$(echo "${dump}" |
-          sed -e '/public symbols/,$!d' -e '/^ \{1,\}Summary/,$d' -e "s/ \{1,\}${prefix}/ /" -e 's/ \{1,\}/ /g' |
-          tail -n +2 |
-          cut -d' ' -f3 |
           grep "^${exp}" |
           sed -e 's/^/    /')
 done