-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.sh
executable file
·59 lines (50 loc) · 1.36 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
#!/bin/bash
# default
DEVICE=p1
# alternatives
for i in p1 p1c p1l p1n; do
[ "$1" == "$i" ] && DEVICE="$i"
done
# VARIANT use
# user limited access; suited for production
# userdebug like "user" but with root access and debuggability; preferred for debugging
# eng development configuration with additional debugging tools
# default
VARIANT=userdebug
# alternatives
for i in user userdebug eng; do
[ "$2" == "$i" ] && VARIANT="$i"
done
# --------------------------------------------
# default
TARGET="cm_$DEVICE-$VARIANT"
# --------------------------------------------
THREADS=$(grep processor /proc/cpuinfo | wc -l)
case "$1" in
distclean)
repo forall -c 'git clean -xdf'
;&
clean)
make clobber
( cd kernel/samsung/p1 ; make mrproper )
( cd kernel/samsung/p1c ; make mrproper )
;;
$DEVICE|"")
time {
source build/envsetup.sh
[ ! -d vendor/cm/proprietary ] && ( cd vendor/cm ; ./get-prebuilts )
lunch "$TARGET"
make -j$THREADS bacon $OTHER
}
;;
*)
echo
echo "usage:"
echo " ${0##*/} [ <action> ]"
echo " ${0##*/} [ <device> ] [ <build-variant> ]"
echo
echo " <action> : clean|distclean|help"
echo " <device> : p1|p1c|p1l|p1n default=$DEVICE"
echo " <variant>: user|userdebug|eng default=$VARIANT"
;;
esac