#!/bin/bash
#
# Copyright 2020,2021 Sony Corporation
#
ARCH="${ARCH:-arm64}"
CROSS_COMPILE="${CROSS_COMPILE:-aarch64-linux-gnu-}"
CC=${CC:-clang}
KERNEL_CFG_DIR=./arch/arm64/configs
CFG_DEFINES="CFG_ROOT=./ CHECK_IO_VIRT=true KERNEL_64BIT=true TRUSTZONE_64=true WIFI_U2_SPEED_ON_U3PORT=true S_PLATFORM=true TARGET_IC=mt5895 WIFI_U2_SPEED_ON_U3PORT=true ANDROID_L_RTC_WAKEUP=true ENABLE_CMDLINE_BOOTREASON=true ANDROID_FASTBOOT_SUPPORT=true ANDROID_RECOVERY_SUPPORT=true SAKURA_CVT_SUPPORT=true BUILD_CFG=rel SONY_MT7662_SUPPORT=true MTD_ENCRYPT_SUPPORT=true SUSPEND_TO_DRAM=true NO_BIM_INTR=true IMPROVE_LOGO_BOOT_TIME=true ENABLE_DVFS=true QUIET_HOT_BOOT=true GPU_SETTING_VER=MALI_G52 USB_ADB=true"
#shellcheck disable=SC2086
make -j bravia_defconfig ARCH="${ARCH}" CROSS_COMPILE="${CROSS_COMPILE}" CC="${CC}" KERNEL_CFG_DIR="${KERNEL_CFG_DIR}" ${CFG_DEFINES}
#shellcheck disable=SC2086
make -j modules ARCH="${ARCH}" CROSS_COMPILE="${CROSS_COMPILE}" CC="${CC}" KERNEL_CFG_DIR="${KERNEL_CFG_DIR}" ${CFG_DEFINES}
#shellcheck disable=SC2086
make -j Image ARCH="${ARCH}" CROSS_COMPILE="${CROSS_COMPILE}"  CC="${CC}" KERNEL_CFG_DIR="${KERNEL_CFG_DIR}" ${CFG_DEFINES}
