Author: bdrewery
Date: Tue Sep 22 05:05:53 2015
New Revision: 288093
URL: https://svnweb.freebsd.org/changeset/base/288093

Log:
  bsd.lib.mk: Simplify CLEANFILES handling.
  
  This limits CLEANFILES removal to just bsd.obj.mk now and removes the need
  for NOPATH_FILES.
  
  This reverts r96529 which was done due to the command line being too long
  for libc.  Since then all architectures now use 256k for ARG_MAX (r170102).
  Regardless of that, the libc CLEANFILES is only 72k now.  Others
  may be larger but not likely to hit the limit.  If needed, we can improve
  the bsd.obj.mk clean: target to split up the list via bmake features.
  
  This also removes some workarounds that are no longer needed.
  - a.out removal
  - OBJS.tmp, which has not been needed since r117080.
  - *.so, which has not been needed since a .so->.So rename in r42450.
  
  This also fixes STATICOBJS and SHLIB_LINK not being in the .NOPATH list.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/share/mk/bsd.lib.mk

Modified: head/share/mk/bsd.lib.mk
==============================================================================
--- head/share/mk/bsd.lib.mk    Tue Sep 22 04:55:28 2015        (r288092)
+++ head/share/mk/bsd.lib.mk    Tue Sep 22 05:05:53 2015        (r288093)
@@ -162,7 +162,7 @@ LDFLAGS+=   -Wl,--version-script=${VERSION
 
 .if defined(LIB) && !empty(LIB) || defined(SHLIB_NAME)
 OBJS+=         ${SRCS:N*.h:R:S/$/.o/}
-NOPATH_FILES+= ${OBJS}
+CLEANFILES+=   ${OBJS} ${STATICOBJS}
 .endif
 
 .if defined(LIB) && !empty(LIB)
@@ -180,7 +180,7 @@ lib${LIB_PRIVATE}${LIB}.a: ${OBJS} ${STA
 .if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB)
 _LIBS+=                lib${LIB_PRIVATE}${LIB}_p.a
 POBJS+=                ${OBJS:.o=.po} ${STATICOBJS:.o=.po}
-NOPATH_FILES+= ${POBJS}
+CLEANFILES+=   ${POBJS}
 
 lib${LIB_PRIVATE}${LIB}_p.a: ${POBJS}
        @${ECHO} building profiled ${LIB} library
@@ -192,7 +192,7 @@ lib${LIB_PRIVATE}${LIB}_p.a: ${POBJS}
 .if defined(SHLIB_NAME) || \
     defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB)
 SOBJS+=                ${OBJS:.o=.So}
-NOPATH_FILES+= ${SOBJS}
+CLEANFILES+=   ${SOBJS}
 .endif
 
 .if defined(SHLIB_NAME)
@@ -238,7 +238,9 @@ ${SHLIB_LINK:R}.ld: ${.CURDIR}/${SHLIB_L
            ${.ALLSRC} > ${.TARGET}
 
 ${SHLIB_NAME_FULL}: ${SHLIB_LINK:R}.ld
+CLEANFILES+=   ${SHLIB_LINK:R}.ld
 .endif
+CLEANFILES+=   ${SHLIB_LINK}
 .endif
 
 ${SHLIB_NAME_FULL}: ${SOBJS}
@@ -279,7 +281,7 @@ lib${LIB_PRIVATE}${LIB}_pic.a: ${SOBJS}
 LINTLIB=       llib-l${LIB}.ln
 _LIBS+=                ${LINTLIB}
 LINTOBJS+=     ${SRCS:M*.c:.c=.ln}
-NOPATH_FILES+= ${LINTOBJS}
+CLEANFILES+=   ${LINTOBJS}
 
 ${LINTLIB}: ${LINTOBJS}
        @${ECHO} building lint library ${.TARGET}
@@ -292,7 +294,10 @@ ${LINTLIB}: ${LINTOBJS}
 .if defined(_SKIP_BUILD)
 all:
 .else
+.if defined(_LIBS) && !empty(_LIBS)
 all: ${_LIBS}
+CLEANFILES+=   ${_LIBS}
+.endif
 
 .if ${MK_MAN} != "no" && !defined(LIBRARIES_ONLY)
 all: _manpages
@@ -423,49 +428,6 @@ ${_S:R}.So: ${_S}
 .endif
 .endif
 
-.if !target(clean)
-clean:
-.if defined(CLEANFILES) && !empty(CLEANFILES)
-       rm -f ${CLEANFILES}
-.endif
-.if defined(LIB) && !empty(LIB)
-       rm -f a.out ${OBJS} ${OBJS:S/$/.tmp/} ${STATICOBJS}
-.endif
-.if !defined(INTERNALLIB)
-.if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB)
-       rm -f ${POBJS} ${POBJS:S/$/.tmp/}
-.endif
-.if defined(SHLIB_NAME) || \
-    defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB)
-       rm -f ${SOBJS} ${SOBJS:.So=.so} ${SOBJS:S/$/.tmp/}
-.endif
-.if defined(SHLIB_NAME)
-.if defined(SHLIB_LINK)
-.if defined(SHLIB_LDSCRIPT) && exists(${.CURDIR}/${SHLIB_LDSCRIPT})
-       rm -f lib${LIB}.ld
-.endif
-       rm -f ${SHLIB_LINK}
-.endif
-.endif # defined(SHLIB_NAME)
-.if defined(WANT_LINT) && defined(LIB) && !empty(LIB)
-       rm -f ${LINTOBJS}
-.endif
-.endif # !defined(INTERNALLIB)
-.if defined(_LIBS) && !empty(_LIBS)
-       rm -f ${_LIBS}
-.endif
-.if defined(CLEANDIRS) && !empty(CLEANDIRS)
-       rm -rf ${CLEANDIRS}
-.endif
-.if !empty(VERSION_DEF) && !empty(SYMBOL_MAPS)
-       rm -f ${VERSION_MAP}
-.endif
-.endif
-
-.if !empty(_LIBS)
-NOPATH_FILES+= ${_LIBS}
-.endif
-
 .include <bsd.obj.mk>
 
 .include <bsd.sys.mk>
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to