#!/bin/bash cp -v /usr/lib/gcc/x86_64-w64-mingw32/10-win32/libgcc_s_seh-1.dll ./ cp -v /usr/lib/gcc/x86_64-w64-mingw32/10-win32/libssp-0.dll ./ cp -v /usr/lib/gcc/x86_64-w64-mingw32/10-win32/libstdc++-6.dll ./ for i in `strings testmodbus-server.exe | grep -i '\.dll$' | grep -e "^lib"` do if [ -e /opt/W64-cross-compile/lib/$i ] then cp -v /opt/W64-cross-compile/lib/$i ./ for j in `strings $i | grep -i '\.dll$' | grep -e "^lib"` do if [ -e /opt/W64-cross-compile/lib/$j ] then cp -v /opt/W64-cross-compile/lib/$j ./ fi if [ -e /usr/x86_64-w64-mingw32/lib/$j ] then cp -v /usr/x86_64-w64-mingw32/lib/$j ./ fi done fi if [ -e /usr/x86_64-w64-mingw32/lib/$i ] then cp -v /usr/x86_64-w64-mingw32/lib/$i ./ fi done