-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·56 lines (43 loc) · 1.08 KB
/
build.sh
File metadata and controls
executable file
·56 lines (43 loc) · 1.08 KB
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
#!/bin/sh
set -e
BASE_DIR="$(readlink -f $(dirname ${0}))"
. "${BASE_DIR}/scripts/utils.sh"
CMAKE=${CMAKE:-cmake}
BUILD_DIR="$(readlink -f build)"
UNPACKED_ASSETS_DIR="${BUILD_DIR}/assets"
if [[ ! -d build ]] || [[ ! -f build/CMakeCache.txt ]]
then
mkdir -p build
pushd_silent build
INSTALL_DIR="${1}"
${CMAKE} \
-DCMAKE_TOOLCHAIN_FILE=cmake/Toolchains/linux-i686.cmake \
-DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
"${BASE_DIR}"
popd_silent
else
INSTALL_DIR=$(sed -n -e "s/^CMAKE_INSTALL_PREFIX:PATH=//p" build/CMakeCache.txt)
fi
function assets_update()
{
declare -a assets_to_update
pushd_silent assets
for file in $(find . -type f)
do
if [[ "${file}" -nt "${INSTALL_DIR}/base/openjo.pk3" ]]
then
assets_to_update+=("${file#./}")
fi
done
if [[ ${#assets_to_update[@]} -ne 0 ]]
then
zip -r "${INSTALL_DIR}/base/openjo.pk3" ${assets_to_update[@]}
fi
popd_silent
}
assets_update
pushd_silent build
make install -j$(nproc)
popd_silent
cd "${INSTALL_DIR}"
./openjo_sp.i386