-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·85 lines (80 loc) · 3.26 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·85 lines (80 loc) · 3.26 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
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
#!/bin/sh
macBuild()
{
echo "Compiling Vortex..."
mkdir "$PWD"/bin/build
mkdir "$PWD"/bin/build/interp
mkdir "$PWD"/bin/build/interp/mac
clang++ \
-Ofast \
-Wno-everything \
-std=c++20 \
"$PWD"/src/Node/Node.cpp \
"$PWD"/src/Lexer/Lexer.cpp \
"$PWD"/src/Parser/Parser.cpp \
"$PWD"/src/Bytecode/Bytecode.cpp \
"$PWD"/src/Bytecode/Generator.cpp \
"$PWD"/src/VirtualMachine/VirtualMachine.cpp \
"$PWD"/src/utils/utils.cpp \
"$PWD"/main.cpp \
-o "$PWD"/bin/build/interp/mac/vortex || { echo 'Compilation failed' ; exit 1; }
while true; do
read -p "Do you want to add Vortex to 'usr/local/bin' and built-in modules to 'usr/local/share'? - this will allow you to call Vortex globally and set it up with built-in modules [y/n] " yn
case $yn in
[Yy]* )
echo "Password required to access usr/local"
sudo -s eval 'cp "$PWD"/bin/build/interp/mac/vortex /usr/local/bin; sudo -s eval; mkdir /usr/local/share/vortex; mkdir /usr/local/share/vortex/modules; echo "Compiling modules..."; cd "Modules"; ./build_modules.sh; cd ..; cp -R "$PWD"/Modules/modules/* /usr/local/share/vortex/modules; cp "$PWD"/scripts/mac/uninstall.sh /usr/local/share/vortex; chmod +x /usr/local/share/vortex/uninstall.sh'
echo "Added Vortex and standard modules to usr/local - Important: To uninstall, you will need to run 'usr/local/share/vortex/uninstall.sh'"; break;;
[Nn]* ) exit;;
* ) echo "Please answer y or n.";;
esac
done
}
linBuild()
{
echo "Compiling Vortex..."
mkdir "$PWD"/bin/build
mkdir "$PWD"/bin/build/interp
mkdir "$PWD"/bin/build/interp/linux
clang++ \
-Ofast \
-Wno-everything \
-std=c++20 \
-stdlib=libc++ \
-pthread \
-ldl \
"$PWD"/src/Node/Node.cpp \
"$PWD"/src/Lexer/Lexer.cpp \
"$PWD"/src/Parser/Parser.cpp \
"$PWD"/src/Bytecode/Bytecode.cpp \
"$PWD"/src/Bytecode/Generator.cpp \
"$PWD"/src/VirtualMachine/VirtualMachine.cpp \
"$PWD"/src/utils/utils.cpp \
"$PWD"/main.cpp \
-o "$PWD"/bin/build/interp/linux/vortex || { echo 'compilation failed' ; exit 1; }
while true; do
read -p "Do you want to add Vortex to 'usr/local/bin' and built-in modules to 'usr/local/share'? - this will allow you to call Vortex globally and set it up with built-in modules [y/n] " yn
case $yn in
[Yy]* )
echo "Password required to access usr/local"
sudo -s eval 'cp "$PWD"/bin/build/interp/linux/vortex /usr/local/bin; sudo -s eval; mkdir /usr/local/share/vortex; mkdir /usr/local/share/vortex/modules; echo "Compiling modules..."; cd "Modules"; ./build_modules_lin.sh; cd ..; cp -R "$PWD"/Modules/modules/* /usr/local/share/vortex/modules; cp "$PWD"/scripts/mac/uninstall.sh /usr/local/share/vortex; chmod +x /usr/local/share/vortex/uninstall.sh'
echo "Added Vortex and standard modules to usr/local - Important: To uninstall, you will need to run 'usr/local/share/vortex/uninstall.sh'"; break;;
[Nn]* ) exit;;
* ) echo "Please answer y or n.";;
esac
done
}
OS="`uname`"
case $OS in
'Linux')
OS='Linux'
echo "Building on Linux..."
linBuild
;;
'Darwin')
OS='Mac'
echo "Building on Mac..."
macBuild
;;
*) ;;
esac