Date: Mon, 7 Dec 2015 16:08:17 +0000 (UTC) From: Bryan Drewery <bdrewery@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291943 - head/share/mk Message-ID: <201512071608.tB7G8H6v095472@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bdrewery Date: Mon Dec 7 16:08:16 2015 New Revision: 291943 URL: https://svnweb.freebsd.org/changeset/base/291943 Log: FAST_DEPEND: Only try to use dependencies from C/C++ SRCS as mkdep did. Rather than try to guess at all of the OBJS variables just use SRCS using the same patterns that mkdep does. This also fixes a mistake where dependencies were being generated with FAST_DEPEND when they were not for mkdep. This happens when OBJS!=SRCS as is the case in gnu/lib/csu where SRCS has 1 file and OBJS has several other files that does not even contain the 1 SRCS file. Generally in these cases the OBJS have custom dependencies defined in their Makefile. If we generate dependencies for those and then load a .depend file, then .IMPSRC may contain duplicate sources and lead to errors such as: cc: error: cannot specify -o when generating multiple output files MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Mon Dec 7 16:08:13 2015 (r291942) +++ head/share/mk/bsd.dep.mk Mon Dec 7 16:08:16 2015 (r291943) @@ -66,7 +66,10 @@ DEPEND_FILTER= C,/,_,g DEPEND_CFLAGS+= -MD ${DEPEND_MP} -MF${DEPENDFILE}.${.TARGET:${DEPEND_FILTER}} DEPEND_CFLAGS+= -MT${.TARGET} CFLAGS+= ${DEPEND_CFLAGS} -DEPENDOBJS+= ${OBJS} ${POBJS} ${SOBJS} +DEPENDSRCS= ${SRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS:M*.cpp} ${SRCS:M*.cc} +.if !empty(DEPENDSRCS) +DEPENDOBJS+= ${DEPENDSRCS:R:S,$,.o,} +.endif .for __obj in ${DEPENDOBJS:O:u} .if ${.MAKEFLAGS:M-V} == "" .sinclude "${DEPENDFILE}.${__obj:${DEPEND_FILTER}}"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201512071608.tB7G8H6v095472>