-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall-vectrec.sh
executable file
·122 lines (122 loc) · 2.77 KB
/
install-vectrec.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#
# INSTALL VECTREC
#
# This script installs already compiled binary files.
# In most cases, this is the easier way, because you don't have to
# install all the developer tools and libraries to build them.
#
#
# Install CMOC
# - Parameter $1: Install folder
#
export INSTALLDIR="$HOME/vectrec"
export PATH="$INSTALLDIR:$PATH"
#
# Detect OS
#
OS="`uname`"
case $OS in
'Linux')
OS='linux'
;;
'Darwin')
OS='macos'
;;
*) ;;
esac
#
# SHOW INFO
#
echo ""
echo "IMPORTANT INFORMATION"
echo "Install script is not yet ready for all platforms"
echo "Please use make-vectrec.sh instead to build VectreC from source"
echo ""
echo "Install path: $INSTALLDIR"
echo ""
#
# Choose maCOS
#
if [[ $OS == 'macos' ]]
then
echo "macOS Info"
echo "If you want install for macOS Intel press 'y' now"
echo "Otherwise VectreC for ARM will be installed"
echo ""
read -p "Press 'y' to install the Intel version, for ARM press 'n' " answer
case ${answer:0:1} in
y|Y )
OS='macos-intel'
echo "macOS Intel version will be installed"
;;
* )
OS='macos-arm'
echo "macOS ARM version will be installed"
;;
esac
fi
#
# Create folder
#
mkdir $INSTALLDIR
#
# ===============================================================================
# BINARIES: Copy all
#
echo
echo "INSTALL VECTREC +++++++++++++++++++++++++++++++++++++++++++++++"
echo
#
# Copy LWTOOLS binaries
#
cp -v vectrec-binaries/$OS/lwar $INSTALLDIR/lwar
cp -v vectrec-binaries/$OS/lwasm $INSTALLDIR/lwasm
cp -v vectrec-binaries/$OS/lwlink $INSTALLDIR/lwlink
cp -v vectrec-binaries/$OS/lwobjdump $INSTALLDIR/lwobjdump
#
# Copy CMOC binary and stdlib
#
cp -v vectrec-binaries/$OS/cmoc $INSTALLDIR/cmoc
cp -v -R vectrec-binaries/$OS/stdlib $INSTALLDIR/stdlib
#
# Copy scripts on macOS
#
if [[ $OS == 'macos-arm' ]]; then
cp -v vectrec-binaries/compile-macos.sh $INSTALLDIR/compile.sh
cp -v vectrec-binaries/start-macos.sh $INSTALLDIR/start.sh
fi
if [[ $OS == 'macos-intel' ]]; then
cp -v vectrec-binaries/compile-macos.sh $INSTALLDIR/compile.sh
cp -v vectrec-binaries/start-macos.sh $INSTALLDIR/start.sh
fi
#
# Copy scripts on linux
#
if [[ $OS == 'linux' ]]; then
cp -v vectrec-binaries/compile-linux.sh $INSTALLDIR/compile.sh
cp -v vectrec-binaries/start-linux.sh $INSTALLDIR/start.sh
fi
chmod a+x $INSTALLDIR/compile.sh
chmod a+x $INSTALLDIR/start.sh
#
# Copy Sample & Tutorial
#
cp -v -R vectrec-sample $INSTALLDIR/sample
cp -v -R tutorial-code $INSTALLDIR/tutorial
#
# Copy emulator binary
#
cp -v vectrec-binaries/$OS/vec2x $INSTALLDIR/vec2x
#
# Copy ROM file
#
mkdir $INSTALLDIR/roms
cp -v vec2x/romfast.bin $INSTALLDIR/roms/romfast.bin
cp -v vec2x/empty.png $INSTALLDIR/roms/empty.png
#
# ===============================================================================
# Finished
#
echo ""
echo "*** VectreC installed ***"
echo ""