diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk index 50a53085183d..35b9de07cca2 100644 --- a/share/mk/bsd.dep.mk +++ b/share/mk/bsd.dep.mk @@ -57,26 +57,6 @@ _MKDEPCC+= ${DEPFLAGS} MKDEPCMD?= CC='${_MKDEPCC}' mkdep DEPENDFILE?= .depend DEPENDFILES= ${DEPENDFILE} -.if ${MK_FAST_DEPEND} == "yes" && ${.MAKE.MODE:Unormal:Mmeta*} == "" -DEPENDFILES+= ${DEPENDFILE}.* -DEPEND_MP?= -MP -# Handle OBJS=../somefile.o hacks. Just replace '/' rather than use :T to -# avoid collisions. -DEPEND_FILTER= C,/,_,g -DEPEND_CFLAGS+= -MD ${DEPEND_MP} -MF${DEPENDFILE}.${.TARGET:${DEPEND_FILTER}} -DEPEND_CFLAGS+= -MT${.TARGET} -CFLAGS+= ${DEPEND_CFLAGS} -DEPENDSRCS= ${SRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS:M*.cpp} ${SRCS:M*.cc} -.if !empty(DEPENDSRCS) -DEPENDOBJS+= ${DEPENDSRCS:R:S,$,.o,} -.endif -.for __obj in ${DEPENDOBJS:O:u} -.if ${.MAKEFLAGS:M-V} == "" -.sinclude "${DEPENDFILE}.${__obj:${DEPEND_FILTER}}" -.endif -DEPENDFILES_OBJS+= ${DEPENDFILE}.${__obj:${DEPEND_FILTER}} -.endfor -.endif # ${MK_FAST_DEPEND} == "yes" # Keep `tags' here, before SRCS are mangled below for `depend'. .if !target(tags) && defined(SRCS) && !defined(NO_TAGS) @@ -168,7 +148,29 @@ ${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$//} .endfor beforedepend: ${DHDRS} beforebuild: ${DHDRS} + + +.if ${MK_FAST_DEPEND} == "yes" && ${.MAKE.MODE:Unormal:Mmeta*} == "" +DEPENDFILES+= ${DEPENDFILE}.* +DEPEND_MP?= -MP +# Handle OBJS=../somefile.o hacks. Just replace '/' rather than use :T to +# avoid collisions. +DEPEND_FILTER= C,/,_,g +DEPEND_CFLAGS+= -MD ${DEPEND_MP} -MF${DEPENDFILE}.${.TARGET:${DEPEND_FILTER}} +DEPEND_CFLAGS+= -MT${.TARGET} +CFLAGS+= ${DEPEND_CFLAGS} +DEPENDSRCS= ${SRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS:M*.cpp} ${SRCS:M*.cc} +.if !empty(DEPENDSRCS) +DEPENDOBJS+= ${DEPENDSRCS:R:S,$,.o,} .endif +.for __obj in ${DEPENDOBJS:O:u} +.if ${.MAKEFLAGS:M-V} == "" +.sinclude "${DEPENDFILE}.${__obj:${DEPEND_FILTER}}" +.endif +DEPENDFILES_OBJS+= ${DEPENDFILE}.${__obj:${DEPEND_FILTER}} +.endfor +.endif # ${MK_FAST_DEPEND} == "yes" +.endif # defined(SRCS) .if ${MK_DIRDEPS_BUILD} == "yes" .include