summaryrefslogtreecommitdiff
path: root/share/mk/bsd.dep.mk
diff options
context:
space:
mode:
authorBryan Drewery <bdrewery@FreeBSD.org>2016-02-24 17:19:13 +0000
committerBryan Drewery <bdrewery@FreeBSD.org>2016-02-24 17:19:13 +0000
commit70ca9ec4b9b8e12a87b7d80793e10dae9afa1f8d (patch)
tree2033f51e1d8ef3d978199f133711d06b70b3822b /share/mk/bsd.dep.mk
parent68add213442714579fd5bdc73b52a8df0dbbb9cb (diff)
downloadsrc-test2-70ca9ec4b9b8e12a87b7d80793e10dae9afa1f8d.tar.gz
src-test2-70ca9ec4b9b8e12a87b7d80793e10dae9afa1f8d.zip
Hook the meta/nofilemon build into using FAST_DEPEND.
FAST_DEPEND is intended to be the "skip 'make depend' and mkdep" feature. Since DIRDEPS_BUILD does this already with some of its own hacks, and filemon doesn't need this, and nofilemon does, teach it how to handle each of these cases. In meta+filemon mode filemon will handle dependencies itself via the meta mode logic in bmake. We still want to set MK_FAST_DEPEND=yes to enable some logic that indicates that 'make depend' is skipped in the traditional sense. The actual .depend.* files will be skipped. When nofilemon is set though we still need to track and generate dependencies. Sponsored by: EMC / Isilon Storage Division
Notes
Notes: svn path=/head/; revision=295987
Diffstat (limited to 'share/mk/bsd.dep.mk')
-rw-r--r--share/mk/bsd.dep.mk30
1 files changed, 20 insertions, 10 deletions
diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk
index 2b9301eed7d6..78b2efbb482a 100644
--- a/share/mk/bsd.dep.mk
+++ b/share/mk/bsd.dep.mk
@@ -173,14 +173,24 @@ ${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$//}
.endfor
-.if ${MK_FAST_DEPEND} == "yes" && \
- (${.MAKE.MODE:Mmeta} == "" || ${.MAKE.MODE:Mnofilemon} != "")
+.if !empty(.MAKE.MODE:Mmeta) && empty(.MAKE.MODE:Mnofilemon)
+_meta_filemon= 1
+.endif
+.if ${MK_FAST_DEPEND} == "yes"
DEPEND_MP?= -MP
# Handle OBJS=../somefile.o hacks. Just replace '/' rather than use :T to
# avoid collisions.
DEPEND_FILTER= C,/,_,g
+DEPENDSRCS= ${SRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS:M*.cpp} ${SRCS:M*.cc}
+.if !empty(DEPENDSRCS)
+DEPENDOBJS+= ${DEPENDSRCS:R:S,$,.o,}
+.endif
+DEPENDFILES_OBJS= ${DEPENDOBJS:O:u:${DEPEND_FILTER}:C/^/${DEPENDFILE}./}
DEPEND_CFLAGS+= -MD ${DEPEND_MP} -MF${DEPENDFILE}.${.TARGET:${DEPEND_FILTER}}
DEPEND_CFLAGS+= -MT${.TARGET}
+# Skip generating or including .depend.* files if in meta+filemon mode since
+# it will track dependencies itself. OBJS_DEPEND_GUESS is still used though.
+.if !defined(_meta_filemon)
.if defined(.PARSEDIR)
# Only add in DEPEND_CFLAGS for CFLAGS on files we expect from DEPENDOBJS
# as those are the only ones we will include.
@@ -189,34 +199,34 @@ CFLAGS+= ${${DEPEND_CFLAGS_CONDITION}:?${DEPEND_CFLAGS}:}
.else
CFLAGS+= ${DEPEND_CFLAGS}
.endif
-DEPENDSRCS= ${SRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS:M*.cpp} ${SRCS:M*.cc}
-.if !empty(DEPENDSRCS)
-DEPENDOBJS+= ${DEPENDSRCS:R:S,$,.o,}
-.endif
-DEPENDFILES_OBJS= ${DEPENDOBJS:O:u:${DEPEND_FILTER}:C/^/${DEPENDFILE}./}
.if !defined(_SKIP_READ_DEPEND)
.for __depend_obj in ${DEPENDFILES_OBJS}
.sinclude "${__depend_obj}"
.endfor
.endif # !defined(_SKIP_READ_DEPEND)
+.endif # !defined(_meta_filemon)
.endif # ${MK_FAST_DEPEND} == "yes"
.endif # defined(SRCS)
.if ${MK_DIRDEPS_BUILD} == "yes"
.include <meta.autodep.mk>
+# If using filemon then _EXTRADEPEND is skipped since it is not needed.
+.if empty(.MAKE.MODE:Mnofilemon)
# this depend: bypasses that below
# the dependency helps when bootstrapping
depend: beforedepend ${DPSRCS} ${SRCS} afterdepend
beforedepend:
afterdepend: beforedepend
.endif
+.endif
# Guess some dependencies for when no ${DEPENDFILE}.OBJ is generated yet.
-# Done here to support meta mode as well which does not always need
-# the CFLAGS modifications or .depend.* included.
+# For meta+filemon the .meta file is checked for since it is the dependency
+# file used.
.if ${MK_FAST_DEPEND} == "yes"
.for __obj in ${DEPENDOBJS:O:u}
-.if !exists(${.OBJDIR}/${DEPENDFILE}.${__obj})
+.if (defined(_meta_filemon) && !exists(${.OBJDIR}/${__obj}.meta)) || \
+ (!defined(_meta_filemon) && !exists(${.OBJDIR}/${DEPENDFILE}.${__obj}))
${__obj}: ${OBJS_DEPEND_GUESS}
${__obj}: ${OBJS_DEPEND_GUESS.${__obj}}
.endif