Last active
August 1, 2019 12:44
-
-
Save fcicq/4408d0836838bbaec6f2b05f25463929 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ $# != 2 ]; then | |
echo usage $0 BINARY FOLDER | |
exit 1 | |
fi | |
if [ ! -f $1 ]; then | |
echo file $1 not found | |
exit | |
fi | |
echo mkdir -p $2 | |
echo mkdir -p "$2/$(dirname $1)" | |
echo cp -L "$1" "$2" | |
for lib in `ldd "$1" | cut -d'>' -f2 | awk '{print \$1}'` ; do | |
echo mkdir -p "$2/$(dirname $lib)" | |
echo [ ! -f "$2/$lib" ] \&\& cp -L "$lib" "$2/$(dirname $lib)" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment