forked from ResurrectionRemix/platform_manifest
/
build.sh
176 lines (161 loc) · 8.84 KB
/
build.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#! /bin/bash
# The Build script to Compile Resurrection Remix
# No scrollback buffer
echo -e '\0033\0143'
# Obtain intial time of script startup
res1=$(date +%s.%N)
# Specify colors utilized in the terminal
red='tput setaf 1' # red
green='tput setaf 2' # green
yellow='tput setaf 3' # yellow
blue='tput setaf 4' # blue
violet='tput setaf 5' # violet
cyan='tput setaf 6' # cyan
white='tput setaf 7' # white
txtbld=$(tput bold) # Bold
bldred=${txtbld}$(tput setaf 1) # Bold red
bldgrn=${txtbld}$(tput setaf 2) # Bold green
bldblu=${txtbld}$(tput setaf 4) # Bold blue
bldcya=${txtbld}$(tput setaf 6) # Bold cyan
normal='tput sgr0'
tput bold
tput setaf 1
clear
echo -e ""
echo -e ""
echo -e " ( ( ( ( ( ) ) "
echo -e " )\ ) )\ ) )\ ) )\ ) ( * ) )\ ) ( /( ( /( "
echo -e " (()/( ( (()/( ( (()/((()/( ( )\ ) /((()/( )\()) )\()) "
echo -e " /(_)))\ /(_)) )\ /(_))/(_)))\ (((_) ( )(_))/(_))((_)\ ((_)\ "
echo -e " (_)) ((_) (_)) _ ((_)(_)) (_)) ((_) )\___ (_(_())(_)) ((_) _((_) "
echo -e " | _ \| __|/ __|| | | || _ \| _ \| __|((/ __||_ _||_ _| / _ \ | \| | "
echo -e " | /| _| \__ \| |_| || /| /| _| | (__ | | | | | (_) || . | "
echo -e " |_|_\|___||___/ \___/ |_|_\|_|_\|___| \___| |_| |___| \___/ |_|\_| "
echo -e ""
echo -e ""
echo -e " ( * ( ) "
echo -e " )\ ) ( )\ ) ( /( "
echo -e " (()/( ( )\))( (()/( )\()) "
echo -e " /(_)))\ ((_)()\ /(_))((_)\ "
echo -e " (_)) ((_) (_()((_)(_)) __((_) "
echo -e " | _ \| __|| \/ ||_ _| \ \/ / "
echo -e " | /| _| | |\/| | | | > < "
echo -e " |_|_\|___||_| |_||___| /_/\_\ "
echo -e ""
echo -e ""
echo -e ""
echo -e ""
sleep 5
clear
echo -e ""
echo -e ""
echo -e "${bldgrn} Setting up build environment..."
echo -e ""
echo -e ""
. build/envsetup.sh
echo -e "Build environment has been set up"
sleep 5
# Clear terminal
clear
# Confirm utilizing the 'make clean' function
echo -e "\n\n${bldgrn} Do you want to delete the /out directory?\n"
echo ""
echo -e "${bldblu} 1. Yes"
echo -e "${bldblu} 2. No"
echo ""
echo ""
$normal
read askclean
if [ "$askclean" == "1" ]
then
echo ""
echo ""
echo -e "${bldgrn} Removing files compiled from previous compilations - Cleaning... "
echo ""
echo ""
$normal
make clean
else
echo -e ""
echo -e ""
echo -e "Continuing compilation of Resurrection Remix without deleting old build files"
echo -e ""
echo -e ""
export USE_CCACHE=1
fi
sleep 5
# Clear terminal
clear
# Lunch device
echo -e ""
echo -e ""
echo -e "${bldcya} Choose your device from the lunch menu..."
echo -e ""
echo -e ""
$normal
$green
sleep 5
lunch
sleep 5
clear
# Start compilation
echo -e ""
echo -e ""
echo -e "${bldcya} Starting compilation of Resurrection Remix..."
echo -e ""
echo -e ""
echo -e "Enter the number of threads you want to use for compilation"
echo -e "If you unsure on what to select, enter 0";
$normal
read threads
if [ "$threads" == "0" ]
then
time mka bacon
else
time make -j$threads
fi
echo -e ""
# Get elapsed time
$blue
res2=$(date +%s.%N)
echo -e ""
echo -e ""
echo "${bldgrn}Total time elapsed: ${txtrst}${grn}$(echo "($res2 - $res1) / 60"|bc ) minutes ($(echo "$res2 - $res1"|bc ) seconds) ${txtrst}"
echo -e ""
echo -e ""
# Compilation complete
tput bold
tput setaf 1
clear
echo -e " "
echo -e "█████████████████████████████████████████████████████████████"
echo -e "█░░░░░░██░░░░░░█░░░░░░░░░░░░░░█░░░░░░██░░░░░░█░░░░░░░░░░░░░░█"
echo -e "█░░▄▀░░██░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█"
echo -e "█░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░░░░░█"
echo -e "█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░█████████"
echo -e "█░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░░░░░█"
echo -e "█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█"
echo -e "█░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░░░░░█"
echo -e "█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀▄▀░░▄▀▄▀░░█░░▄▀░░█████████"
echo -e "█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█░░░░▄▀▄▀▄▀░░░░█░░▄▀░░░░░░░░░░█"
echo -e "█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░███░░░░▄▀░░░░███░░▄▀▄▀▄▀▄▀▄▀░░█"
echo -e "█░░░░░░██░░░░░░█░░░░░░██░░░░░░█████░░░░░░█████░░░░░░░░░░░░░░█"
echo -e "█████████████████████████████████████████████████████████████"
echo -e "█████████████████████████████████████████████████████████████"
echo -e "█░░░░░░░░░░░░░░█░░░░░░██░░░░░░█░░░░░░██████████░░░░░░█░░░░░░█"
echo -e "█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░░░░░██░░▄▀░░█░░▄▀░░█"
echo -e "█░░▄▀░░░░░░░░░░█░░▄▀░░██░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░██░░▄▀░░█░░▄▀░░█"
echo -e "█░░▄▀░░█████████░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░▄▀░░██░░▄▀░░█░░▄▀░░█"
echo -e "█░░▄▀░░░░░░░░░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░██░░▄▀░░█░░▄▀░░█"
echo -e "█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░██░░▄▀░░█░░▄▀░░█"
echo -e "█░░▄▀░░░░░░░░░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░██░░▄▀░░█░░░░░░█"
echo -e "█░░▄▀░░█████████░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░░░░░▄▀░░████████"
echo -e "█░░▄▀░░█████████░░▄▀░░░░░░▄▀░░█░░▄▀░░██░░▄▀▄▀▄▀▄▀▄▀░░█░░░░░░█"
echo -e "█░░▄▀░░█████████░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░░░░░░░░░▄▀░░█░░▄▀░░█"
echo -e "█░░░░░░█████████░░░░░░░░░░░░░░█░░░░░░██████████░░░░░░█░░░░░░█"
echo -e "█████████████████████████████████████████████████████████████"
echo -e " "
echo -e " Compilation Completed! Congratulations on the succesful build!"
EXPORT_CCACHE=1
# Switch terminal back to normal
$normal