This repository was archived by the owner on Jan 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathbuild
More file actions
executable file
·137 lines (117 loc) · 1.85 KB
/
Copy pathbuild
File metadata and controls
executable file
·137 lines (117 loc) · 1.85 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
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
#!/bin/bash
cd ..
export USE_CCACHE=1
# Define functions
function build_rom {
. build/envsetup.sh
breakfast $1
mka bacon
}
function build_boot {
. build/envsetup.sh
breakfast $1
mka bootimage
}
function build_recovery {
. build/envsetup.sh
breakfast $1
mka recoveryimage
}
# Check 1st option
case "$1" in
i9105 )
DEVICE=$1
FAST=1
;;
i9105p )
DEVICE=$1
FAST=1
;;
s2plus )
BOTH=1
DEVICE='i9105 i9105p'
FAST=1
;;
"" )
;;
* )
echo Unknown 1st option: $1
exit 0
;;
esac
# If 1st option used, check 2nd option
if [[ $FAST ]]; then
case "$2" in
-b|--make-boot )
BOOT=1
MORE=1
;;
-r|--make-recovery )
RECOVERY=1
MORE=1
;;
-c|--make-clean )
CLEAN=1
;;
"" )
;;
* )
echo Unknown 2nd option: $2
exit 0
esac
fi
# Fast building if options used
if [[ $FAST && !($MORE) ]]; then
# Clean if needed
if [[ $CLEAN ]]; then
make clean
fi
# Build for only device
if [[ !($BOTH) ]]; then
build_rom $DEVICE
# Build for both devices
else
for DNAME in $DEVICE; do
build_rom $DNAME
done
fi
# Make boot image
elif [[ $BOOT ]]; then
# Make it for only device
if [[ !($BOTH) ]]; then
build_boot $DEVICE
# Make it for both devices
else
for DNAME in $DEVICE; do
build_boot $DNAME
done
fi
# Make recovery image
elif [[ $RECOVERY ]]; then
# Make it for only device
if [[ !($BOTH) ]]; then
build_recovery $DEVICE
# Make it for both devices
else
for DNAME in $DEVICE; do
build_recovery $DNAME
done
fi
fi
# Normal building if no options used
if [[ !($FAST) ]]; then
echo -n 'Make it clean? (y/N): '
read CLEAN
# Clean if needed
if [[ $CLEAN ]]; then
make clean
fi
echo -n 'Device? (i9105 or i9105p): '
read DEVICE
# Check if given proper device DNAME
if [[ $DEVICE != i9105 && $DEVICE != i9105p ]]; then
echo Unknown device DNAME: $DEVICE
exit 0
fi
build_rom
fi