-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
29 lines (23 loc) · 630 Bytes
/
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
#!/bin/bash
# Change to the Source Directory
cd $SYNC_PATH
# Set-up ccache
if [ -z "$CCACHE_SIZE" ]; then
ccache -M 10G
else
ccache -M ${CCACHE_SIZE}
fi
# Prepare the Build Environment
source build/envsetup.sh
# lunch the target
lunch ${LUNCH_COMBO} || { echo "ERROR: Failed to lunch the target!" && exit 1; }
# Build the Code
if [ -z "$J_VAL" ]; then
mka -j$(nproc --all) $TARGET || { echo "ERROR: Build Failed!" && exit 1; }
elif [ "$J_VAL"="0" ]; then
mka $TARGET || { echo "ERROR: Build Failed!" && exit 1; }
else
mka -j${J_VAL} $TARGET || { echo "ERROR: Build Failed!" && exit 1; }
fi
# Exit
exit 0