cvs commit: src/sys/conf kmod.mk
Ruslan Ermilov
ru at FreeBSD.org
Thu Apr 21 11:59:32 PDT 2005
On Thu, Apr 21, 2005 at 05:43:25PM +1000, Bruce Evans wrote:
> The depend target doesn't, and possibly can't or shouldn't have enough
> dependencies to know whether .depend should be rebuilt. This is handled
> in a different way in kernel makefiles. Kernel makefiles always
> rebuild, and application makefiles only rebuilt if one of the depended-on
> files that they know about (mainly *.c) has changed. I'm fairly happy
> with this different behaviour.
>
That's where we have a problem -- some of us are happy with the
behavior, some of us want all be similar, and some of us don't
like it. (I don't.)
> The kernel is self-contained (at least
> if you don't use the modules mistake), so it is easy to tell when its
> .depend file should be rebuilt and avoid doing it unnecessarily, and
> if you do it unnecessarily it only takes a short time to rebuild.
>
Short time -- maybe. I still consider it a major mistake that
"make depend" followed by "make depend" does something -- it
shouldn't.
> OTOH,
> "make depend" for the src tree would rebuild hundreds of makefiles if
> it always rebuilt.
>
Of .depend files, yes. This is evil.
> Another dependency bug that sometimes bites me: "make" doesn't work
> after "make clean", at least under the old version of -current that I
> use, because dependencies for lots of generated sources (like device_if.c
> (?)) are missing. Dependencies for older generated files like
> vnode_if.c are handled correctly, and "make depend" doesn't have
> the problem because the necessary dependencies are in BEFORE_DEPEND.
>
Maybe this is only an old bug, as there are these lines in kern.post.mk:
.if !exists(${.OBJDIR}/.depend)
${SYSTEM_OBJS}: assym.s vnode_if.h ${BEFORE_DEPEND:M*.h} ${MFILES:T:S/.m$/.h/}
.endif
At least "make -n kernel >/dev/null" after "make clean" doesn't
complain now.
> >I proposed the following: with NO_CLEAN builds, default to always
> >regenerating .depend files (by moving the old .depend files out of
> >the way like is done in kern.post.mk), but provide a mean to skip
> >regenerating .depend files, NO_CLEANDEPEND.
>
> My version hasn't lost the support for not building .depend files
> (which is just a pessimization on the !NOCLEAN^H^H^H^H^H_CLEAN case).
> It has a knob _NODEPEND which is always set in the NOCLEAN case and
> can be set by the user in the !NOCLEAN case to prevent building of
> .depend files. It removes old .depend files instead of moving them
> out of the way as in bsd.prog.mk:
>
> %%%
> .if !defined(NOCLEAN)
> _NODEPEND= true
> .endif
> .if defined(_NODEPEND)
> DEPEND= cleandepend
> .else
> DEPEND= depend
> .endif
> %%%
>
> (Then s/depend/${DEPEND} almost everywhere else.)
>
> I think the default for NOCLEAN should be to not rebuild dependencies.
> It is supposed to be fast at the expense of correctness.
>
So do I, but I also want it to be a case for the kernel build.
> You often
> want it to restart a build from where it failed, and then you don't
> especially want it to rebuild all the makefiles before that point.
>
Yes, agreed. In case of upgrades, it's easy to "make cleandepend"
first.
Cheers,
--
Ruslan Ermilov
ru at FreeBSD.org
FreeBSD committer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-src/attachments/20050421/ddfa9536/attachment.bin
More information about the cvs-src
mailing list