-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.sh
51 lines (40 loc) · 1.25 KB
/
build.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
44
45
46
47
48
49
50
51
export CLANG_PATH=$HOME_DIR/tc/clang-r487747c/bin
export PATH=${BINUTILS_PATH}:${CLANG_PATH}:${PATH}
make -j8 CC='ccache clang' ARCH=arm64 LLVM=1 LLVM_IAS=1 O=out gki_defconfig
#!/bin/bash
# Resources
THREAD="-j$(nproc --all)"
export CLANG_PATH=$HOME_DIR/tc/clang-r487747c/bin/
export PATH=${CLANG_PATH}:${PATH}
export CLANG_TRIPLE=aarch64-linux-gnu-
export CROSS_COMPILE=$HOME_DIR/tc/clang-r487747c/bin/aarch64-linux-gnu- CC=clang CXX=clang++
DEFCONFIG="gki_defconfig"
# Paths
KERNEL_DIR=`pwd`
ZIMAGE_DIR="$KERNEL_DIR/out/arch/arm64/boot"
# Vars
export ARCH=arm64
export SUBARCH=$ARCH
export KBUILD_BUILD_USER=saikiran
DATE_START=$(date +"%s")
echo "DEFCONFIG SET TO $DEFCONFIG"
echo "-------------------"
echo "Making Kernel:"
echo "-------------------"
echo
make CC="ccache clang" CXX="ccache clang++" LLVM=1 LLVM_IAS=1 O=out $DEFCONFIG
make CC='ccache clang' CXX="ccache clang++" LLVM=1 LLVM_IAS=1 O=out $THREAD 2>&1 | tee kernel.log
echo
echo "-------------------"
echo "Build Completed in:"
echo "-------------------"
echo
DATE_END=$(date +"%s")
DIFF=$(($DATE_END - $DATE_START))
echo "Time: $(($DIFF / 60)) minute(s) and $(($DIFF % 60)) seconds."
echo
ls -a $ZIMAGE_DIR
cd $KERNEL_DIR
TIME="$(date "+%Y%m%d-%H%M%S")"
mkdir -p tmp
cp -fp $ZIMAGE_DIR/Image.gz tmp