Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jan 2016 17:39:59 +0000 (UTC)
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r294738 - stable/9/share/mk
Message-ID:  <201601251739.u0PHdxnw076801@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bdrewery
Date: Mon Jan 25 17:39:59 2016
New Revision: 294738
URL: https://svnweb.freebsd.org/changeset/base/294738

Log:
  MFC r294370:
  
    mkdep: Fix -include not being added for .depend tracking.

Modified:
  stable/9/share/mk/bsd.dep.mk
Directory Properties:
  stable/9/share/mk/   (props changed)

Modified: stable/9/share/mk/bsd.dep.mk
==============================================================================
--- stable/9/share/mk/bsd.dep.mk	Mon Jan 25 17:38:20 2016	(r294737)
+++ stable/9/share/mk/bsd.dep.mk	Mon Jan 25 17:39:59 2016	(r294738)
@@ -126,12 +126,27 @@ depend: beforedepend ${DEPENDFILE} after
 # Tell bmake not to look for generated files via .PATH
 .NOPATH: ${DEPENDFILE}
 
+.if ${MK_FAST_DEPEND} == "no"
+# Capture -include from CFLAGS.
+# This could be simpler with bmake :tW but needs to support fmake for MFC.
+_CFLAGS_INCLUDES= ${CFLAGS:Q:S/\\ /,/g:C/-include,/-include%/g:C/,/ /g:M-include*:C/%/ /g}
+_CXXFLAGS_INCLUDES= ${CXXFLAGS:Q:S/\\ /,/g:C/-include,/-include%/g:C/,/ /g:M-include*:C/%/ /g}
+# XXX: Temporary hack to workaround .depend files not tracking -include
+.if !empty(_CFLAGS_INCLUDES)
+${OBJS} ${POBJS} ${SOBJS}: ${_CFLAGS_INCLUDES:M*.h}
+.endif
+.if !empty(_CXXFLAGS_INCLUDES)
+${OBJS} ${POBJS} ${SOBJS}: ${_CXXFLAGS_INCLUDES:M*.h}
+.endif
+
 # Different types of sources are compiled with slightly different flags.
 # Split up the sources, and filter out headers and non-applicable flags.
 MKDEP_CFLAGS=	${CFLAGS:M-nostdinc*} ${CFLAGS:M-[BIDU]*} ${CFLAGS:M-std=*} \
-		${CFLAGS:M-ansi}
+		${CFLAGS:M-ansi} ${_CFLAGS_INCLUDES}
 MKDEP_CXXFLAGS=	${CXXFLAGS:M-nostdinc*} ${CXXFLAGS:M-[BIDU]*} \
-		${CXXFLAGS:M-std=*} ${CXXFLAGS:M-ansi} ${CXXFLAGS:M-stdlib=*}
+		${CXXFLAGS:M-std=*} ${CXXFLAGS:M-ansi} ${CXXFLAGS:M-stdlib=*} \
+		${_CXXFLAGS_INCLUDES}
+.endif	# ${MK_FAST_DEPEND} == "no"
 
 DPSRCS+= ${SRCS}
 ${DEPENDFILE}: ${DPSRCS}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601251739.u0PHdxnw076801>