META_MODE: Don't generate or read _EXTRADEPEND dependencies when using filemon.

The DPADD data in .depend will be redundant with what is in the .meta file.

Also extend NO_EXTRADEPEND support to bsd.prog.mk.

Approved by:	re (blanket, META_MODE)
Sponsored by:	EMC / Isilon Storage Division
This commit is contained in:
Bryan Drewery 2016-06-21 21:55:03 +00:00
parent 51b68003d9
commit 799483e49e
4 changed files with 25 additions and 17 deletions

View File

@ -72,10 +72,16 @@ tags: ${SRCS}
.endif
.endif
.if !empty(.MAKE.MODE:Mmeta) && empty(.MAKE.MODE:Mnofilemon)
_meta_filemon= 1
.endif
# Skip reading .depend when not needed to speed up tree-walks
# and simple lookups.
# 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)
make(install*) || make(analyze) || defined(_meta_filemon)
_SKIP_READ_DEPEND= 1
.if ${MK_DIRDEPS_BUILD} == "no"
.MAKE.DEPENDFILE= /dev/null
@ -157,9 +163,6 @@ ${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$//}
.endfor
.if !empty(.MAKE.MODE:Mmeta) && empty(.MAKE.MODE:Mnofilemon)
_meta_filemon= 1
.endif
.if ${MAKE_VERSION} < 20160220
DEPEND_MP?= -MP
.endif
@ -173,8 +176,6 @@ DEPENDOBJS+= ${DEPENDSRCS:R:S,$,.o,}
DEPENDFILES_OBJS= ${DEPENDOBJS:O:u:${DEPEND_FILTER}:C/^/${DEPENDFILE}./}
DEPEND_CFLAGS+= -MD ${DEPEND_MP} -MF${DEPENDFILE}.${.TARGET:${DEPEND_FILTER}}
DEPEND_CFLAGS+= -MT${.TARGET}
# Skip generating or including .depend.* files if in meta+filemon mode since
# it will track dependencies itself. OBJS_DEPEND_GUESS is still used though.
.if !defined(_meta_filemon)
.if defined(.PARSEDIR)
# Only add in DEPEND_CFLAGS for CFLAGS on files we expect from DEPENDOBJS
@ -201,7 +202,7 @@ CFLAGS+= ${DEPEND_CFLAGS}
.depend:
.include <meta.autodep.mk>
# If using filemon then _EXTRADEPEND is skipped since it is not needed.
.if empty(.MAKE.MODE:Mnofilemon)
.if defined(_meta_filemon)
# this depend: bypasses that below
# the dependency helps when bootstrapping
depend: beforedepend ${DPSRCS} ${SRCS} afterdepend
@ -245,15 +246,18 @@ depend: beforedepend ${DEPENDFILE} afterdepend
DPSRCS+= ${SRCS}
# A .depend file will only be generated if there are commands in
# beforedepend/_EXTRADEPEND/afterdepend. The target is kept
# to allow 'make depend' to generate files.
# beforedepend/_EXTRADEPEND/afterdepend The _EXTRADEPEND target is
# ignored if using meta+filemon since it handles all dependencies. The other
# targets are kept as they be used for generating something. The target is
# kept to allow 'make depend' to generate files.
${DEPENDFILE}: ${DPSRCS}
.if exists(${.OBJDIR}/${DEPENDFILE}) || \
((commands(beforedepend) || commands(_EXTRADEPEND) || \
((commands(beforedepend) || \
(!defined(_meta_filemon) && commands(_EXTRADEPEND)) || \
commands(afterdepend)) && !empty(.MAKE.MODE:Mmeta))
rm -f ${DEPENDFILE}
.endif
.if target(_EXTRADEPEND)
.if !defined(_meta_filemon) && target(_EXTRADEPEND)
_EXTRADEPEND: .USE
${DEPENDFILE}: _EXTRADEPEND
.endif

View File

@ -178,6 +178,7 @@ CLEANFILES+= ${OBJS}
.include <bsd.libnames.mk>
.if defined(PROG)
.if !defined(NO_EXTRADEPEND)
_EXTRADEPEND:
.if defined(LDFLAGS) && !empty(LDFLAGS:M-nostdlib)
.if defined(DPADD) && !empty(DPADD)
@ -193,6 +194,7 @@ _EXTRADEPEND:
.endif
.endif
.endif
.endif # !defined(NO_EXTRADEPEND)
.endif
.if !target(install)

View File

@ -75,6 +75,8 @@ META_MODE?= normal
# buildworld -> installworld -> buildworld to rebuild everything.
# Since the build is self-reliant and bootstraps everything it needs,
# this should not be a real problem for incremental builds.
# XXX: This relies on the existing host tools retaining ABI compatibility
# through upgrades since they won't be rebuilt on header/library changes.
# Note that these are prefix matching, so /lib matches /libexec.
.MAKE.META.IGNORE_PATHS+= \
${__MAKE_SHELL} \

View File

@ -189,11 +189,16 @@ genassym.o: $S/$M/$M/genassym.c
${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.
# 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*) || \
make(kernel-install*)
make(kernel-install*) || defined(_meta_filemon)
_SKIP_READ_DEPEND= 1
.MAKE.DEPENDFILE= /dev/null
.endif
@ -203,11 +208,6 @@ SRCS= assym.s vnode_if.h ${BEFORE_DEPEND} ${CFILES} \
${SYSTEM_CFILES} ${GEN_CFILES} ${SFILES} \
${MFILES:T:S/.m$/.h/}
DEPENDFILES= .depend .depend.*
# Skip generating or including .depend.* files if in meta+filemon mode since
# it will track dependencies itself. OBJS_DEPEND_GUESS is still used though.
.if !empty(.MAKE.MODE:Unormal:Mmeta) && empty(.MAKE.MODE:Unormal:Mnofilemon)
_meta_filemon= 1
.endif
DEPENDOBJS+= ${SYSTEM_OBJS} genassym.o
DEPENDFILES_OBJS= ${DEPENDOBJS:O:u:C/^/.depend./}
.if ${MAKE_VERSION} < 20160220