forked from enforc/android_kernel_lge_sm8150_new
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build_alpha.sh
executable file
·43 lines (35 loc) · 1.17 KB
/
build_alpha.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
#!/bin/bash
echo
echo "Clean Build Directory"
echo
make clean && make mrproper
echo
echo "Issue Build Commands"
echo
mkdir -p out
export ARCH=arm64
export SUBARCH=arm64
export CLANG_PATH=~/toolchains/weebx-clang15/bin
export PATH=${CLANG_PATH}:${PATH}
export CROSS_COMPILE=aarch64-linux-gnu-
export CROSS_COMPILE_ARM32=arm-linux-gnueabi-
export CLANG_TRIPLE=aarch64-linux-gnu-
echo
echo "Set DEFCONFIG"
echo
make CC=clang AR=llvm-ar NM=llvm-nm OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump STRIP=llvm-strip O=out vendor/dragon_alpha_defconfig
echo
echo "Build The Good Stuff"
echo
make CC=clang AR=llvm-ar NM=llvm-nm OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump STRIP=llvm-strip O=out -j24
# Copy the current Image.gz-dtb to history with incremented name
history_dir=./release/Dragon/history-alpha
mkdir -p $history_dir
current_file=./release/Dragon/Image-alpha.gz-dtb
if [ -f "$current_file" ]; then
n=$(ls $history_dir | grep -oP '^Image-alpha\K\d+(?=\.gz-dtb$)' | sort -nr | head -n1)
n=$((n + 1))
cp -f "$current_file" "$history_dir/Image-alpha${n}.gz-dtb"
fi
# Copy the new build to the release directory
cp -f ./out/arch/arm64/boot/Image.gz-dtb ./release/Dragon/Image-alpha.gz-dtb