FAST_DEPEND: Fix 'make all install' not properly rebuilding based on .depend.* files.

An optimization is in place to skip reading the .depend.* files with
'make install'.  This was too strong and broke 'make all install' and
'make foo.o foo install'.  Now only skip reading the dependency files
if all make targets ran are install targets.

The problem comes about because headers are only added in as a guessed
dependency if .depend.* files do not yet exist.  If they do exist, even
if being skipped from being read, then the header dependencies are not
applied.  This applies to all #included files, and not just headers.

Reported by:	kib
MFC after:	1 day
Sponsored by:	EMC / Isilon Storage Division
This commit is contained in:
Bryan Drewery 2016-08-23 19:37:18 +00:00
parent 1075729090
commit c30c436a58
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=304697
2 changed files with 8 additions and 6 deletions

View File

@ -76,12 +76,13 @@ tags: ${SRCS}
_meta_filemon= 1
.endif
# Skip reading .depend when not needed to speed up tree-walks
# and simple lookups.
# Skip reading .depend when not needed to speed up tree-walks and simple
# lookups. For install, only do this if no other targets are specified.
# Also skip generating or including .depend.* files if in meta+filemon mode
# since it will track dependencies itself. OBJS_DEPEND_GUESS is still used.
.if !empty(.MAKEFLAGS:M-V${_V_READ_DEPEND}) || make(obj) || make(clean*) || \
make(install*) || make(analyze) || defined(_meta_filemon)
${.TARGETS:M*install*} == ${.TARGETS} || \
make(analyze) || defined(_meta_filemon)
_SKIP_READ_DEPEND= 1
.if ${MK_DIRDEPS_BUILD} == "no"
.MAKE.DEPENDFILE= /dev/null

View File

@ -196,12 +196,13 @@ ${SYSTEM_OBJS} genassym.o vers.o: opt_global.h
.if !empty(.MAKE.MODE:Unormal:Mmeta) && empty(.MAKE.MODE:Unormal:Mnofilemon)
_meta_filemon= 1
.endif
# Skip reading .depend when not needed to speed up tree-walks
# and simple lookups.
# Skip reading .depend when not needed to speed up tree-walks and simple
# lookups. For install, only do this if no other targets are specified.
# Also skip generating or including .depend.* files if in meta+filemon mode
# since it will track dependencies itself. OBJS_DEPEND_GUESS is still used.
.if !empty(.MAKEFLAGS:M-V${_V_READ_DEPEND}) || make(obj) || make(clean*) || \
make(install*) || make(kernel-obj) || make(kernel-clean*) || \
${.TARGETS:M*install*} == ${.TARGETS} || \
make(kernel-obj) || make(kernel-clean*) || \
make(kernel-install*) || defined(_meta_filemon)
_SKIP_READ_DEPEND= 1
.MAKE.DEPENDFILE= /dev/null