summaryrefslogtreecommitdiff
path: root/quick_build_kernel.sh (plain)
blob: 40470e9e218092905b479dd2cb142a884a95cbd3
1#!/bin/bash
2
3function usage()
4{
5 echo "Usage:"
6 echo " Please run the script in android top directory"
7 echo " $0 bootimage --> build uImage"
8 echo " $0 recoveryimage --> build recovery uImage"
9 echo " $0 menuconfig --> kernel menuconfig"
10 echo " $0 savedefconfig --> save kernel defconfig for commit"
11 echo " $0 build-modules --> build projects to ko modules"
12 exit
13}
14
15if [ "$OUT" == "" -o "$TARGET_PRODUCT" == "" ]; then
16 echo Please source envsetup.sh and select lunch.
17 exit 1
18fi
19if [ "$PRODUCT_OUT" == "" ]; then
20 export PRODUCT_OUT=out/target/product/$TARGET_PRODUCT
21fi
22if [ "$TARGET_OUT_INTERMEDIATES" == "" ]; then
23 export TARGET_OUT_INTERMEDIATES=$PRODUCT_OUT/obj
24fi
25if [ "$TARGET_OUT" == "" ]; then
26 export TARGET_OUT=$PRODUCT_OUT/system
27fi
28
29
30if [ $# -eq 0 ]; then
31 usage;
32fi
33
34if [ "$1" != "bootimage" ] && [ "$1" != "recoveryimage" ] \
35 && [ "$1" != "menuconfig" ] && [ "$1" != "savedefconfig" ] \
36 && [ "$1" != "build-modules" ]; then
37 usage;
38fi
39
40if [ "$1" == "bootimage" ]; then
41 make -f device/amlogic/$TARGET_PRODUCT/Kernel.mk -j6 bootimage-quick
42fi
43
44if [ "$1" == "recoveryimage" ]; then
45 make -f device/amlogic/$TARGET_PRODUCT/Kernel.mk -j6 recoveryimage-quick
46fi
47
48if [ "$1" == "menuconfig" ]; then
49 make -f device/amlogic/$TARGET_PRODUCT/Kernel.mk kernelconfig
50fi
51
52if [ "$1" == "savedefconfig" ]; then
53 make -i -f device/amlogic/$TARGET_PRODUCT/Kernel.mk savekernelconfig
54fi
55
56if [ "$1" == "build-modules" ]; then
57 make -f device/amlogic/$TARGET_PRODUCT/Kernel.mk -j8 build-modules-quick
58fi
59