forked from Galaxy-MT6768/android_kernel_samsung_a31
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuildKernel.sh
More file actions
executable file
·52 lines (41 loc) · 1.29 KB
/
buildKernel.sh
File metadata and controls
executable file
·52 lines (41 loc) · 1.29 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
#!/bin/bash
# Written by Hakalle (Velosh) <hakalle@proton.me>.
# Clone GCC & Proton Clang.
[[ -d "$(pwd)/gcc/" ]] || git clone https://github.com/VH-Devices/toolchains -b gcc-10.3.0 gcc --depth 1 >> /dev/null 2> /dev/null
[[ -d "$(pwd)/clang/" ]] || git clone https://github.com/kdrag0n/proton-clang clang --depth 1 >> /dev/null 2> /dev/null
# Export KBUILD_BUILD_{USER,HOST} flags.
export KBUILD_BUILD_USER="zyzoh"
export KBUILD_BUILD_HOST="zyzoh"
# Export ARCH/SUBARCH flags.
export ARCH="arm64"
export SUBARCH="arm64"
# Export CCACHE
export CCACHE_EXEC="$(which ccache)"
export CCACHE="${CCACHE_EXEC}"
export CCACHE_COMPRESS="1"
export USE_CCACHE="1"
$CCACHE -M 50G
# Export toolchain/clang/llvm flags
export CROSS_COMPILE="$(pwd)/gcc/bin/aarch64-buildroot-linux-gnu-"
export CLANG_TRIPLE="aarch64-linux-gnu-"
export CC="$(pwd)/clang/bin/clang"
# Export if/else outdir var
export WITH_OUTDIR=true
# Clear the console
clear
# Remove out dir folder and clean the source
if [ "${WITH_OUTDIR}" == true ]; then
if [ -d "$(pwd)/a31" ]; then
rm -rf a31
fi
fi
# Build time
if [ "${WITH_OUTDIR}" == true ]; then
if [ ! -d "$(pwd)/a31" ]; then
mkdir a31
fi
fi
if [ "${WITH_OUTDIR}" == true ]; then
"${CCACHE}" make O="$(pwd)/a31" a31_defconfig
"${CCACHE}" make -j`nproc` O="$(pwd)/a31"
fi