svn commit: r291945 - head/share/mk
Bryan Drewery
bdrewery at FreeBSD.org
Mon Dec 7 16:08:24 UTC 2015
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
More information about the svn-src-head
mailing list