aboutsummaryrefslogtreecommitdiff
path: root/sys/conf/kern.post.mk
diff options
context:
space:
mode:
authorBryan Drewery <bdrewery@FreeBSD.org>2016-02-24 17:19:05 +0000
committerBryan Drewery <bdrewery@FreeBSD.org>2016-02-24 17:19:05 +0000
commitd7beff082b71fb7d1b4ca94d3cc44d64bbbfb2d6 (patch)
treee02f021af7d6f2e079bc0d65c88722f3f2cb08ee /sys/conf/kern.post.mk
parentcc66670114402843c814c45d57abd56a1fc0625b (diff)
downloadsrc-d7beff082b71fb7d1b4ca94d3cc44d64bbbfb2d6.tar.gz
src-d7beff082b71fb7d1b4ca94d3cc44d64bbbfb2d6.zip
FAST_DEPEND: Rework how guessed dependencies are handled.
Rather than depend on .depend not existing, check the actual .depend.OBJ file that will be used for that object. If it doesn't exist then use the guessed dependencies. FAST_DEPEND may never have a .depend file. Not having one means all of the previous logic would over-depend all object files on all headers which is not what we wanted. It also means that if a .depend is generated before a build is done for _EXTRADEPEND (such as for PROG or LIB) then all of these dependencies would not be used since the .depend wasn't generated from mkdep and the real .depend.* files are not generated until the build. Sponsored by: EMC / Isilon Storage Division
Notes
Notes: svn path=/head/; revision=295985
Diffstat (limited to 'sys/conf/kern.post.mk')
-rw-r--r--sys/conf/kern.post.mk20
1 files changed, 15 insertions, 5 deletions
diff --git a/sys/conf/kern.post.mk b/sys/conf/kern.post.mk
index a82d904227fc..f1ab570edac1 100644
--- a/sys/conf/kern.post.mk
+++ b/sys/conf/kern.post.mk
@@ -143,8 +143,10 @@ ${FULLKERNEL}: ${SYSTEM_DEP} vers.o
.endif
${SYSTEM_LD_TAIL}
-.if !exists(${.OBJDIR}/.depend)
-${SYSTEM_OBJS}: assym.s vnode_if.h ${BEFORE_DEPEND:M*.h} ${MFILES:T:S/.m$/.h/}
+OBJS_DEPEND_GUESS+= assym.s vnode_if.h ${BEFORE_DEPEND:M*.h} \
+ ${MFILES:T:S/.m$/.h/}
+.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/.depend)
+${SYSTEM_OBJS}: ${OBJS_DEPEND_GUESS}
.endif
LNFILES= ${CFILES:T:S/.c$/.ln/}
@@ -239,10 +241,18 @@ CFLAGS+= ${DEPEND_CFLAGS}
DEPENDOBJS+= ${SYSTEM_OBJS} genassym.o
DEPENDFILES_OBJS= ${DEPENDOBJS:O:u:C/^/.depend./}
.if !defined(_SKIP_READ_DEPEND)
-.for __depend_obj in ${DEPENDFILES_OBJS}
-.sinclude "${__depend_obj}"
-.endfor
+.for __obj in ${DEPENDOBJS}
+.if exists(${.OBJDIR}/.depend.${__obj})
+.include ".depend.${__obj}"
+.else
+# Guess some dependencies for when no .depend.OBJ is generated yet.
+.if ${SYSTEM_OBJS:M${__obj}}
+${__obj}: ${OBJS_DEPEND_GUESS}
.endif
+${__obj}: ${OBJS_DEPEND_GUESS.${__obj}}
+.endif
+.endfor
+.endif # !defined(_SKIP_READ_DEPEND)
.endif # ${MK_FAST_DEPEND} == "yes"
.NOPATH: .depend ${DEPENDFILES_OBJS}