summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2016-06-21 21:55:03 +0000
committerbdrewery <bdrewery@FreeBSD.org>2016-06-21 21:55:03 +0000
commit8f9b4b00a24e0b5d13a25df826e4e2c20e0d2ced (patch)
tree433d8e4b116c53eb20d43dbc7e676f6274aff272 /share
parentc25477e01e673f662fef75537c8d50fd2f6c9ae4 (diff)
downloadFreeBSD-src-8f9b4b00a24e0b5d13a25df826e4e2c20e0d2ced.zip
FreeBSD-src-8f9b4b00a24e0b5d13a25df826e4e2c20e0d2ced.tar.gz
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
Diffstat (limited to 'share')
-rw-r--r--share/mk/bsd.dep.mk26
-rw-r--r--share/mk/bsd.prog.mk2
-rw-r--r--share/mk/sys.mk2
3 files changed, 19 insertions, 11 deletions
diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk
index 077cc4b..bddf575 100644
--- a/share/mk/bsd.dep.mk
+++ b/share/mk/bsd.dep.mk
@@ -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
diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk
index 742eba9..9dbe325 100644
--- a/share/mk/bsd.prog.mk
+++ b/share/mk/bsd.prog.mk
@@ -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)
diff --git a/share/mk/sys.mk b/share/mk/sys.mk
index b337aa2..3dcd404 100644
--- a/share/mk/sys.mk
+++ b/share/mk/sys.mk
@@ -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} \
OpenPOWER on IntegriCloud