This repository has been archived by the owner on Jan 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildLinux.sh
executable file
·74 lines (48 loc) · 3.33 KB
/
buildLinux.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
#! /usr/bin/env bash
# ------------------------------------------------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------------------
[ "${BASH_VERSION%.*}" \> "3.1" ] || { echo >&2 "${0##*/}: Bash 3.1 or higher only"; exit 1; }
# ------------------------------------------------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------------------
# Script must be executed at the same level.
rep=$(pwd)
[ "${0%/*}" = "." ] || { echo >&2 "${0##*/}: Must be executed at the same level"; exit 1; }
# ------------------------------------------------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------------------
# Paths.
destination="${rep}/build"
bin="${rep}/bin"
tcl="${rep}/tcl"
help="${rep}/resources/help"
# ------------------------------------------------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------------------
# Remove previous build.
[ -e "${destination}" ] && { rm -r "${destination}"; }
# ------------------------------------------------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------------------
# Build the binaries.
echo "Build ..."
cd "${rep}/src" || exit 1
make -f makefile.linux || exit 1
cd "${rep}" || exit 1
# ------------------------------------------------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------------------
# Create the directory.
echo "Create directory ..."
mkdir "${destination}" || exit 1
cp -R "${bin}" "${destination}" || exit 1
cp -R "${tcl}" "${destination}" || exit 1
cp -R "${help}" "${destination}" || exit 1
# ------------------------------------------------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------------------
# Clean the build.
echo "Clean ..."
cd "${rep}/src" || exit 1
make -f makefile.linux clean || exit 1
cd "${rep}" || exit 1
# ------------------------------------------------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------------------
# End.
echo "SUCCEEDED"
# ------------------------------------------------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------------------