Re-building Linux kernel without "clean"
The make clean
is only for the deb-pkg
target. Take a look at scripts/package/Makefile
:
deb-pkg: FORCE
$(MAKE) clean
$(call cmd,src_tar,$(KDEB_SOURCENAME))
$(MAKE) KBUILD_SRC=
+$(call cmd,builddeb)
bindeb-pkg: FORCE
$(MAKE) KBUILD_SRC=
+$(call cmd,builddeb)
If you build the bindeb-pkg
instead, it won't do a clean. You probably don't need the source packages anyway.
I suspect it does a clean because it doesn't want to tar up build artifacts in the source tarball.
You could try producing those deb packages with a different tool, make-kpkg
that is installed by apt-get install kernel-package
. Then for example
make-kpkg --rootcmd=fakeroot --initrd --uc --us -j2 kernel_image kernel_headers
This command should not do a make clean
each time.