solana/scripts/install-native-programs.sh

28 lines
617 B
Bash
Raw Normal View History

#!/usr/bin/env bash
2018-10-09 15:54:15 -07:00
#
# Installs native programs as |cargo install| doesn't know about them
#
2018-11-11 09:25:59 -08:00
set -e
2018-10-09 15:54:15 -07:00
here=$(dirname "$0")
SOLANA_ROOT="$(cd "$here"/..; pwd)"
installDir=$1
variant=${2:-release}
if [[ -z $installDir ]]; then
echo Install directory not specified
exit 1
fi
for dir in "$SOLANA_ROOT"/programs/native/*; do
for program in echo "$SOLANA_ROOT"/target/"$variant"/deps/lib{,solana_}"$(basename "$dir")"{,_program}.{so,dylib,dll}; do
2018-10-09 15:54:15 -07:00
if [[ -f $program ]]; then
2018-12-09 08:41:40 -08:00
mkdir -p "$installDir"
2018-12-07 09:32:15 -08:00
rm -f "$installDir/$(basename "$program")"
2018-10-09 15:54:15 -07:00
cp -v "$program" "$installDir"
fi
done
done