build-kernel.sh: Add --verbose flag
This adds a --verbose flag to build-kernel.sh to dump the
actual compiler commands being used during the build.
Change-Id: I3aa7d9e7a45ea13d08b517b3c17f73697f9fe73f
diff --git a/distrib/build-kernel.sh b/distrib/build-kernel.sh
index 5838da3..7b6f7b5 100755
--- a/distrib/build-kernel.sh
+++ b/distrib/build-kernel.sh
@@ -42,6 +42,7 @@
OPTION_ARCH=
OPTION_CONFIG=
OPTION_JOBS=
+OPTION_VERBOSE=
for opt do
optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)')
@@ -63,6 +64,9 @@
--config=*)
OPTION_CONFIG=$optarg
;;
+ --verbose)
+ OPTION_VERBOSE=true
+ ;;
-j*)
OPTION_JOBS=$optarg
;;
@@ -83,6 +87,7 @@
echo " --out=<directory> output directory [$OUTPUT]"
echo " --cross=<prefix> cross-toolchain prefix [$CROSSPREFIX]"
echo " --config=<name> kernel config name [$CONFIG]"
+ echo " --verbose show build commands"
echo " -j<number> launch <number> parallel build jobs [$JOBS]"
echo ""
echo "NOTE: --armv7 is equivalent to --config=goldfish_armv7. It is"
@@ -197,11 +202,16 @@
export REAL_CROSS_COMPILE="$CROSS_COMPILE"
CROSS_COMPILE=$(dirname "$0")/kernel-toolchain/android-kernel-toolchain-
+MAKE_FLAGS=
+if [ "$OPTION_VERBOSE" ]; then
+ MAKE_FLAGS="$MAKE_FLAGS V=1"
+fi
+
# Do the build
#
rm -f include/asm &&
make ${CONFIG}_defconfig && # configure the kernel
-make -j$JOBS # build it
+make -j$JOBS $MAKE_FLAGS # build it
if [ $? != 0 ] ; then
echo "Could not build the kernel. Aborting !"