mirror of
https://github.com/openwrt/openwrt.git
synced 2026-10-14 02:19:06 +04:00
kbuild runs twice per build, for the modules and for the image, and takes about half a second each time even if there is nothing to do. Store a hash of the kbuild command line after a successful run, and skip the next run if the hash is the same and no file in the kernel tree or the toolchain is newer than the stamp. The OpenWrt files at the top of the kernel tree are ignored, apart from .config. Directories are ignored, as kbuild changes them with temporary files, so a deleted file alone does not trigger a run. With CONFIG_STRIP_KERNEL_EXPORTS the image link reads symtab.h, which sits above the kernel tree and follows the modules of the packages. The scan of the image run names that file as well. The workaround that deletes vmlinux now only runs together with kbuild. Signed-off-by: John Crispin <john@phrozen.org>