diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 25cf2fecb61e..84f4ca783d75 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -160,6 +160,7 @@ LDFLAGS+= -L${_SHLIBDIRPREFIX}${LIBPRIVATEDIR} -rpath ${LIBPRIVATEDIR} .if defined(LIB) && !empty(LIB) || defined(SHLIB_NAME) OBJS+= ${SRCS:N*.h:R:S/$/.o/} +NOPATH_FILES+= ${OBJS} .endif .if defined(LIB) && !empty(LIB) @@ -181,6 +182,7 @@ lib${LIB}.a: ${OBJS} ${STATICOBJS} .if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB) _LIBS+= lib${LIB}_p.a POBJS+= ${OBJS:.o=.po} ${STATICOBJS:.o=.po} +NOPATH_FILES+= ${POBJS} lib${LIB}_p.a: ${POBJS} @${ECHO} building profiled ${LIB} library @@ -196,6 +198,7 @@ lib${LIB}_p.a: ${POBJS} .if defined(SHLIB_NAME) || \ defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) SOBJS+= ${OBJS:.o=.So} +NOPATH_FILES+= ${SOBJS} .endif .if defined(SHLIB_NAME) @@ -254,6 +257,7 @@ lib${LIB}_pic.a: ${SOBJS} LINTLIB= llib-l${LIB}.ln _LIBS+= ${LINTLIB} LINTOBJS+= ${SRCS:M*.c:.c=.ln} +NOPATH_FILES+= ${LINTOBJS} ${LINTLIB}: ${LINTOBJS} @${ECHO} building lint library ${.TARGET} @@ -454,6 +458,10 @@ clean: .endif .endif +.if !empty(_LIBS) +NOPATH_FILES+= ${_LIBS} +.endif + .include .include diff --git a/share/mk/bsd.obj.mk b/share/mk/bsd.obj.mk index 634261eba594..95122e8ea01b 100644 --- a/share/mk/bsd.obj.mk +++ b/share/mk/bsd.obj.mk @@ -119,8 +119,9 @@ cleanobj: clean cleandepend @if [ -L ${.CURDIR}/obj ]; then rm -f ${.CURDIR}/obj; fi # Tell bmake not to look for generated files via .PATH -.if !empty(CLEANFILES) -.NOPATH: ${CLEANFILES} +NOPATH_FILES+= ${CLEANFILES} +.if !empty(NOPATH_FILES) +.NOPATH: ${NOPATH_FILES} .endif .if !target(clean)