#!/bin/sh
# to increase build speed (especially for bisect) install ccache and raise cache size: ccache -M 5G
RELEASE=1
[ -x /usr/bin/ccache ] && CC="ccache gcc"
rm -vf  ../linux-image-*.deb ../linux-headers-*.deb ../linux-firmware-image*.deb ../linux-libc-dev*.deb
make localmodconfig
make clean
if [ "$CC" ]; then
 time make -j`grep -c ^processor /proc/cpuinfo 2>/dev/null||echo 1` CC="$CC" KDEB_PKGVERSION=0$(whoami)$RELEASE INSTALL_MOD_STRIP=1 deb-pkg
else
 time make -j`grep -c ^processor /proc/cpuinfo 2>/dev/null||echo 1` KDEB_PKGVERSION=0$(whoami)$RELEASE INSTALL_MOD_STRIP=1 deb-pkg
fi
echo install kernel using: dpkg -i ../linux-image-*.deb ../linux-headers-*.deb
