kernel: Add simpler make depend variant for kernel.
authorzrj <rimvydas.jasinskas@gmail.com>
Mon, 28 May 2018 15:07:31 +0000 (18:07 +0300)
committerzrj <zrj@dragonflybsd.org>
Tue, 29 May 2018 07:07:47 +0000 (10:07 +0300)
commit319f97f77182b64c8785d66eb06b219b3d8f4801
tree4e0aded5ee2e6defb23dace3021cb5617d05758d
parent2d5f0bdad8b8f0945582d41bcbe4ae6d037d3740
kernel: Add simpler make depend variant for kernel.

For now only for make {build,native}kernel -DNO_MODULES. The modules part
is more involved and will follow next.

Idea is to avoid a seprate mkdep(1) run before the actual compilation by
simply writing out separate dependency files while compiling in one go.
This variant reuses depenency information from last compilation, while
mkdep(1) variant reconstructs the dep chains on the current tree.
Depending if headers where removed or added both variants can miss out.

Due to several constraints (checks in makefiles if .depend file already
exists and implicit handling of device firmware stub files) try to mimic
previous behaviour by reconstructing depend on next quickkernel.
Later on we could remove anchoring on hack.So, creation of .depend file
and include all foo.d dependency files directly using bmake's .dinclude
directive that acts on stale dependencies as .MAKE.DEPENDFILE .depend.
Also turns out mkdep(1) was not tracking deps for ${MFILES:S/.m$/.c/}},
this simpler variant catches them and only vmx_genassym.d is not hooked
in .depend (coming from sys/platform/pc64/conf/files).
Shaves ~30s for make -jN nativekernel -DNO_MODULES.
sys/conf/kern.post.mk
sys/conf/kern.pre.mk