diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 0f8be4588a9d..2b7eef999bb9 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -417,30 +417,35 @@ lint: ${SRCS:M*.c} .if defined(LIB) && !empty(LIB) OBJS_DEPEND_GUESS+= ${SRCS:M*.h} -.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/${DEPENDFILE}) -${OBJS} ${STATICOBJS} ${POBJS}: ${OBJS_DEPEND_GUESS} -.endif .for _S in ${SRCS:N*.[hly]} OBJS_DEPEND_GUESS.${_S:R}.po= ${_S} -.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/${DEPENDFILE}) -${_S:R}.po: ${OBJS_DEPEND_GUESS.${_S:R}.po} -.endif .endfor .endif .if defined(SHLIB_NAME) || \ defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) -.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/${DEPENDFILE}) -${SOBJS}: ${OBJS_DEPEND_GUESS} -.endif .for _S in ${SRCS:N*.[hly]} OBJS_DEPEND_GUESS.${_S:R}.So= ${_S} -.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/${DEPENDFILE}) -${_S:R}.So: ${OBJS_DEPEND_GUESS.${_S:R}.So} -.endif .endfor .endif .include + +.if defined(LIB) && !empty(LIB) +.if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/${DEPENDFILE}) +${OBJS} ${STATICOBJS} ${POBJS}: ${OBJS_DEPEND_GUESS} +.for _S in ${SRCS:N*.[hly]} +${_S:R}.po: ${OBJS_DEPEND_GUESS.${_S:R}.po} +.endfor +.if defined(SHLIB_NAME) || \ + defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) +${SOBJS}: ${OBJS_DEPEND_GUESS} +.for _S in ${SRCS:N*.[hly]} +${_S:R}.So: ${OBJS_DEPEND_GUESS.${_S:R}.So} +.endfor +.endif +.endif +.endif + .include .include .include diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index f45e39970c43..44b7e9d376ee 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -277,12 +277,16 @@ lint: ${SRCS:M*.c} .if defined(PROG) OBJS_DEPEND_GUESS+= ${SRCS:M*.h} +.endif + +.include + +.if defined(PROG) .if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/${DEPENDFILE}) ${OBJS}: ${OBJS_DEPEND_GUESS} .endif .endif -.include .include .include .include diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index 2afdd8a60701..ddfc981026a3 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -456,11 +456,13 @@ cleanilinks: rm -f ${_ILINKS} OBJS_DEPEND_GUESS+= ${SRCS:M*.h} + +.include + .if ${MK_FAST_DEPEND} == "no" && !exists(${.OBJDIR}/${DEPENDFILE}) ${OBJS}: ${OBJS_DEPEND_GUESS} .endif -.include .include .include .include "kern.mk"