-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathcompile.sh
57 lines (41 loc) · 1.38 KB
/
compile.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#! /usr/bin/env bash
# Bash script for change coin files
# Exit immediately if an error occurs, or if an undeclared variable is used
set -o errexit
[ "$OSTYPE" != "win"* ] || die "Windows is not supported"
# A POSIX variable
OPTIND=1 # Reset in case getopts has been used previously in the shell.
while getopts "c:z" opt; do
case "$opt" in
c) COMPILE_ARGS=${OPTARG}
;;
z) archive=1
esac
done
archive=${archive:-0}
shift $((OPTIND-1))
cd ${NEW_COIN_PATH}
# Compile!
if [[ "$OSTYPE" == "msys" ]]; then
cmake -G "Visual Studio 12 Win64" "..\.."
msbuild.exe Bytecoin.sln /property:Configuration=Release ${COMPILE_ARGS}
else
make release-static ${COMPILE_ARGS}
fi
if [[ $? == "0" ]]; then
echo "Compilation successful"
fi
# Move and zip binaries
if [[ $archive == "1" ]]; then
BUILD_PATH="${WORK_FOLDERS_PATH}/builds"
ALL_BUILD_FILES="${__CONFIG_core_CRYPTONOTE_NAME}-all-files"
rm -rf ${BUILD_PATH}/${ALL_BUILD_FILES}
mkdir -p ${BUILD_PATH}/${ALL_BUILD_FILES}
cp -R ${NEW_COIN_PATH}/build/release/bin/ ${BUILD_PATH}/${ALL_BUILD_FILES}/
if [[ " ${__CONFIG_extensions_text} " == *"multiply.json"* ]]; then
git clone https://github.com/forknote/configs.git ${BUILD_PATH}/${ALL_BUILD_FILES}/configs
rm -rf ${BUILD_PATH}/${ALL_BUILD_FILES}/configs/.git
rm -rf ${BUILD_PATH}/${ALL_BUILD_FILES}/configs/.gitignore
fi
rm -rf "${NEW_COIN_PATH}/build"
fi