svn commit: r248212 - projects/bmake/share/mk

Simon J. Gerraty sjg at FreeBSD.org
Tue Mar 12 17:23:24 UTC 2013


Author: sjg
Date: Tue Mar 12 17:23:23 2013
New Revision: 248212
URL: http://svnweb.freebsd.org/changeset/base/248212

Log:
  If .MAKE.DEPENDFILE_DEFAULT is not machine qualified, and we
  find oursleves creating a machine qualified .MAKE.DEPENDFILE which
  is identical to a default which exists - skip it.
  
  This allows us to create Makefile.depend.host where it matters,
  while leveraging Makefile.depend where it is sufficient.

Modified:
  projects/bmake/share/mk/gendirdeps.mk

Modified: projects/bmake/share/mk/gendirdeps.mk
==============================================================================
--- projects/bmake/share/mk/gendirdeps.mk	Tue Mar 12 17:21:03 2013	(r248211)
+++ projects/bmake/share/mk/gendirdeps.mk	Tue Mar 12 17:23:23 2013	(r248212)
@@ -276,6 +276,10 @@ CAT_DEPEND ?= .depend
 # .depend may contain things we don't want.
 # The sed command at the end of the stream, allows for the filters
 # to output _{VAR} tokens which we will turn into proper ${VAR} references.
+# Note: if we have a non-machine qualified .MAKE.DEPENDFILE_DEFAULT
+# which exists and _DEPENDFILE does not yet and is machine qualified;
+# compare new _DEPENDFILE to default and if they are the same we do
+# not need _DEPENDFILE.
 ${_DEPENDFILE}: ${CAT_DEPEND:M.depend} ${META_FILES:O:u:@m@${exists($m):?$m:}@} ${_this} ${META2DEPS}
 	@(echo '# Autogenerated - do NOT edit!'; echo; \
 	echo 'DEP_RELDIR := $${_PARSEDIR:S,$${SRCTOP}/,,}'; echo; \
@@ -288,6 +292,9 @@ ${_DEPENDFILE}: ${CAT_DEPEND:M.depend} $
 	echo '# local dependencies - needed for -jN in clean tree'; \
 	[ -s ${CAT_DEPEND} ] && { grep : ${CAT_DEPEND} | grep -v '[/\\]'; }; \
 	echo '.endif' ) | sed 's,_\([{(]\),$$\1,g' > $@.new${.MAKE.PID}
+.if ${.MAKE.DEPENDFILE_DEFAULT:E} != ${MACHINE} && ${@:E} == ${MACHINE} && !exists($@) && exists(${@:H}/${.MAKE.DEPENDFILE_DEFAULT:T})
+	@cmp -s ${@:H}/${.MAKE.DEPENDFILE_DEFAULT:T} $@.new${.MAKE.PID} && rm $@.new${.MAKE.PID}; :
+.endif
 	@${InstallNew}; InstallNew -s $@.new${.MAKE.PID}
 
 .endif				# meta2deps failed


More information about the svn-src-projects mailing list