forked from Kanonify/Stellaris_kernel_sony_tama
-
Notifications
You must be signed in to change notification settings - Fork 1
/
compile.sh
43 lines (34 loc) · 1.07 KB
/
compile.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 -e "==========================="
echo -e "= START COMPILING KERNEL ="
echo -e "==========================="
bold=$(tput bold)
normal=$(tput sgr0)
# Scrip option
while (( ${#} )); do
case ${1} in
"-Z"|"--zip") ZIP=true ;;
esac
shift
done
[[ -z ${ZIP} ]] && { echo "${bold}LOADING-_-....${normal}"; }
DEFCONFIG="tama_aurora_defconfig"
export KBUILD_BUILD_USER=Kanonify
export KBUILD_BUILD_HOST=aurora
TC_DIR="/usr/bin"
export PATH="$TC_DIR/bin:$PATH"
if [[ $1 = "-r" || $1 = "--regen" ]]; then
make O=out ARCH=arm64 $DEFCONFIG savedefconfig
cp out/defconfig arch/arm64/configs/$DEFCONFIG
exit
fi
rm -R out
mkdir -p out
make O=out ARCH=arm64 $DEFCONFIG
make -j$(nproc --all) O=out ARCH=arm64 CC=clang LD=ld.lld AR=llvm-ar AS=llvm-as NM=llvm-nm OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump STRIP=llvm-strip CROSS_COMPILE=aarch64-linux-gnu- CROSS_COMPILE_ARM32=arm-linux-gnueabi- 2>&1 | tee log.txt
echo -e "==========================="
echo -e " COMPILE KERNEL COMPLETE "
echo -e "==========================="
if [[ ":v" ]]; then
exit
fi