-
Notifications
You must be signed in to change notification settings - Fork 10
/
make.sh
executable file
·84 lines (75 loc) · 1.47 KB
/
make.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/usr/bin/env bash
FZL_DIR="`dirname ${0}`"
FZL_PATH="`realpath ${FZL_DIR}`"
FZL_INSTALL_PATH="${HOME}/.fuzzle/"
PZL_DIR="`dirname ${0}`/fuzzle/puzzle/"
PZL_PATH="`realpath ${PZL_DIR}`"
PZL_BUILD_PATH="${FZL_PATH}/fuzzle/puzzle/build/"
UZL_DIR="`dirname ${0}`/fuzzle/uuzzle"
UZL_PATH=`realpath ${UZL_DIR}`
UZL_BUILD_PATH="${FZL_PATH}/fuzzle/uuzzle/build"
build_puzzle()
{
# Compile puzzle
mkdir "${PZL_BUILD_PATH}" &> /dev/null
cd "${PZL_BUILD_PATH}"
cmake "${PZL_PATH}" -DCMAKE_INSTALL_PREFIX=${FZL_INSTALL_PATH}
make
}
build_uuzzle()
{
# Compile uuzzle
mkdir "${UZL_BUILD_PATH}" &> /dev/null
cd "${UZL_BUILD_PATH}"
cmake "${UZL_PATH}" -DCMAKE_PREFIX_PATH=${FZL_INSTALL_PATH}
make
}
build_uuzzle_trace()
{
# Compile uuzzle
mkdir "${UZL_BUILD_PATH}" &> /dev/null
cd "${UZL_BUILD_PATH}"
cmake "${UZL_PATH}" \
-DCMAKE_PREFIX_PATH=${FZL_INSTALL_PATH} \
-DCMAKE_C_FLAGS="-D__WITH_TRACE__"
make
}
install_puzzle()
{
cd "${PZL_BUILD_PATH}"
make install
}
install_fuzzle()
{
cd ${FZL_PATH}
pip3 install . --upgrade
}
default()
{
build_puzzle
install_puzzle
build_uuzzle
install_fuzzle
}
trace()
{
build_puzzle
install_puzzle
build_uuzzle_trace
install_fuzzle
}
clean()
{
rm -r "${PZL_BUILD_PATH}"
rm -r "${FZL_INSTALL_PATH}"
rm -r "${UZL_BUILD_PATH}"
pip uninstall fuzzle -y
}
case $1 in
# Default
"" ) default ;;
# Trace
"trace" ) trace ;;
# Clean
"clean" ) clean ;;
esac