From owner-svn-src-all@freebsd.org Mon Dec 7 16:08:24 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADB9F9A06A8; Mon, 7 Dec 2015 16:08:24 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 36EA11E6E; Mon, 7 Dec 2015 16:08:24 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7G8NYN095566; Mon, 7 Dec 2015 16:08:23 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7G8Npk095564; Mon, 7 Dec 2015 16:08:23 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512071608.tB7G8Npk095564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 7 Dec 2015 16:08:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291945 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 16:08:24 -0000 Author: bdrewery Date: Mon Dec 7 16:08:22 2015 New Revision: 291945 URL: https://svnweb.freebsd.org/changeset/base/291945 Log: FAST_DEPEND: Only pass -MF if we care about the object being compiled. This will save time generating dependency files that we didn't expect due to cases where SRCS!=OBJS or for building custom targetted objects in Makefiles that do not end up in the DEPENDOBJS list. This uses a bmake trick to modify CFLAGS based on ${.TARGET}. A .PARSEDIR check is done for the sake of MFC safety. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk head/share/mk/bsd.lib.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Mon Dec 7 16:08:19 2015 (r291944) +++ head/share/mk/bsd.dep.mk Mon Dec 7 16:08:22 2015 (r291945) @@ -158,7 +158,14 @@ DEPEND_MP?= -MP DEPEND_FILTER= C,/,_,g DEPEND_CFLAGS+= -MD ${DEPEND_MP} -MF${DEPENDFILE}.${.TARGET:${DEPEND_FILTER}} DEPEND_CFLAGS+= -MT${.TARGET} +.if defined(.PARSEDIR) +# Only add in DEPEND_CFLAGS for CFLAGS on files we expect from DEPENDOBJS +# as those are the only ones we will include. +DEPEND_CFLAGS_CONDITION= !empty(DEPENDOBJS:M${.TARGET:${DEPEND_FILTER}}) +CFLAGS+= ${${DEPEND_CFLAGS_CONDITION}:?${DEPEND_CFLAGS}:} +.else CFLAGS+= ${DEPEND_CFLAGS} +.endif DEPENDSRCS= ${SRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS:M*.cpp} ${SRCS:M*.cc} .if !empty(DEPENDSRCS) DEPENDOBJS+= ${DEPENDSRCS:R:S,$,.o,} Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Mon Dec 7 16:08:19 2015 (r291944) +++ head/share/mk/bsd.lib.mk Mon Dec 7 16:08:22 2015 (r291945) @@ -182,6 +182,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} +DEPENDOBJS+= ${POBJS} CLEANFILES+= ${POBJS} lib${LIB_PRIVATE}${LIB}_p.a: ${POBJS} @@ -194,6 +195,7 @@ lib${LIB_PRIVATE}${LIB}_p.a: ${POBJS} .if defined(SHLIB_NAME) || \ defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) SOBJS+= ${OBJS:.o=.So} +DEPENDOBJS+= ${SOBJS} CLEANFILES+= ${SOBJS} .endif