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.
This commit is contained in:
sjg 2013-03-12 17:23:23 +00:00
parent b44c493437
commit db7f95f364

View File

@ -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} ${META_FILES:O:u:@m@${exists($m):?$m:}@}
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