summaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build.sh')
-rw-r--r--build.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/build.sh b/build.sh
new file mode 100644
index 000000000000..f59ce393dd54
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# Defining Vars
+# WARNING
+# Clang must be below version 14
+COMPILERS_DIR=$(pwd)/toolchains
+COMPILER="https://github.com/LineageOS/android_prebuilts_gcc_linux-x86_aarch64_aarch64-linux-android-4.9"
+COMPILER32="https://github.com/LineageOS/android_prebuilts_gcc_linux-x86_arm_arm-linux-androideabi-4.9"
+DEFCONFIG="lavender_defconfig"
+KERNEL_DIR=$(pwd)
+PATH="${COMPILERS_DIR}/gcc/bin:${COMPILERS_DIR}/gcc32/bin:${PATH}"
+
+# Grabbing Compilers
+mkdir -p "$COMPILERS_DIR"
+cd "$COMPILERS_DIR"
+git clone "$COMPILER" gcc
+git clone "$COMPILER32" gcc32
+cd "$KERNEL_DIR"
+
+# Compiling Kernel
+mkdir -p build/modout
+make O=build ARCH=arm64 CC=clang CLANG_TRIPLE=aarch64-linux-gnu- CROSS_COMPILE=aarch64-linux-android- CROSS_COMPILE_ARM32=arm-linux-androideabi- "$DEFCONFIG"
+make O=build ARCH=arm64 CC=clang CLANG_TRIPLE=aarch64-linux-gnu- CROSS_COMPILE=aarch64-linux-android- CROSS_COMPILE_ARM32=arm-linux-androideabi- menuconfig
+make -j10 O=build ARCH=arm64 CC=clang CLANG_TRIPLE=aarch64-linux-gnu- CROSS_COMPILE=aarch64-linux-android- CROSS_COMPILE_ARM32=arm-linux-androideabi-
+make O=build ARCH=arm64 CC=clang CLANG_TRIPLE=aarch64-linux-gnu- CROSS_COMPILE=aarch64-linux-android- CROSS_COMPILE_ARM32=arm-linux-androideabi- INSTALL_MOD_PATH="modout" INSTALL_MOD_STRIP=1 modules_install