bsd.lib.mk does not add OBJS etc to CLEANFILES so does not automatically

get them flagged as .NOPATH.  This hurts people who don't use obj dirs.
Since its clean target seprate rm's for things, use NOPATH_FILES as list
to collect things that need .NOPATH.

bsd.obj.mk will add CLEANFILES to NOPATH_FILES and do the deed if needed.

Reviewed by: sbruno
This commit is contained in:
Simon J. Gerraty 2014-07-22 00:42:55 +00:00
parent b177c333d4
commit 49217bc51e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=268970
2 changed files with 11 additions and 2 deletions

View File

@ -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 <bsd.obj.mk>
.include <bsd.sys.mk>

View File

@ -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)