summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorgjb <gjb@FreeBSD.org>2016-03-14 18:54:29 +0000
committergjb <gjb@FreeBSD.org>2016-03-14 18:54:29 +0000
commit086e6f562ffbb6de24f1e51c7df40f403dd1522b (patch)
tree7aa3dd8f24b6558f2ef57be4db6203ac91424ea3 /share
parent1c7e318a9a31cae130bd5b2de01d93e7800f66ff (diff)
parentaab6aadc586e30f7b3512d20c6a5f780bddc2de3 (diff)
downloadFreeBSD-src-086e6f562ffbb6de24f1e51c7df40f403dd1522b.zip
FreeBSD-src-086e6f562ffbb6de24f1e51c7df40f403dd1522b.tar.gz
MFH
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'share')
-rw-r--r--share/examples/Makefile9
-rw-r--r--share/examples/Makefile.depend12
-rw-r--r--share/i18n/esdb/BIG5/Makefile4
-rw-r--r--share/i18n/esdb/Makefile.part8
-rw-r--r--share/i18n/esdb/UTF/Makefile4
-rw-r--r--share/man/man5/src.conf.514
-rw-r--r--share/man/man9/sx.912
-rw-r--r--share/mk/bsd.dep.mk6
-rw-r--r--share/mk/bsd.files.mk4
-rw-r--r--share/mk/bsd.opts.mk2
-rw-r--r--share/mk/bsd.subdir.mk5
-rw-r--r--share/mk/bsd.sys.mk3
-rw-r--r--share/mk/dirdeps.mk64
-rw-r--r--share/mk/gendirdeps.mk6
-rw-r--r--share/mk/local.meta.sys.mk13
-rw-r--r--share/mk/local.sys.mk28
-rw-r--r--share/mk/meta.autodep.mk4
-rw-r--r--share/mk/meta.stage.mk6
-rw-r--r--share/mk/meta.sys.mk2
-rw-r--r--share/mk/sys.dependfile.mk6
-rw-r--r--share/sendmail/Makefile5
-rw-r--r--share/sendmail/Makefile.depend1
-rw-r--r--share/zoneinfo/Makefile9
-rw-r--r--share/zoneinfo/Makefile.depend1
24 files changed, 150 insertions, 78 deletions
diff --git a/share/examples/Makefile b/share/examples/Makefile
index c71604e..827afa9 100644
--- a/share/examples/Makefile
+++ b/share/examples/Makefile
@@ -220,9 +220,10 @@ PACKAGE_bhyve/vmrun.sh= bhyve
SHARED?= copies
beforeinstall: ${SHARED} etc-examples
+META_TARGETS+= copies symlinks
.ORDER: ${SHARED} etc-examples
-copies:
+copies: ${META_DEPS}
.for i in ${LDIRS}
if [ -L ${DESTDIR}${BINDIR}/$i ]; then \
rm -f ${DESTDIR}${BINDIR}/$i; \
@@ -235,7 +236,7 @@ copies:
${.CURDIR}/${file} ${DESTDIR}${BINDIR}/${file}
.endfor
-symlinks:
+symlinks: ${META_DEPS}
.for i in ${LDIRS}
rm -rf ${DESTDIR}${BINDIR}/$i
ln -s ${.CURDIR}/$i ${DESTDIR}${BINDIR}/$i
@@ -243,7 +244,7 @@ symlinks:
etc-examples:
.if ${SHARED} != "symlinks"
- (cd ${.CURDIR}/../../etc; ${MAKE} etc-examples)
+ ${_+_}(cd ${.CURDIR}/../../etc; ${MAKE} etc-examples)
.endif
.if ${SHARED} != "symlinks"
@@ -262,4 +263,4 @@ SUBDIR+=tests
SUBDIR_PARALLEL=
-.include <bsd.subdir.mk>
+.include <bsd.prog.mk>
diff --git a/share/examples/Makefile.depend b/share/examples/Makefile.depend
new file mode 100644
index 0000000..d7cfba0
--- /dev/null
+++ b/share/examples/Makefile.depend
@@ -0,0 +1,12 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ usr.bin/xinstall.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/share/i18n/esdb/BIG5/Makefile b/share/i18n/esdb/BIG5/Makefile
index 4852b83..f7b1512 100644
--- a/share/i18n/esdb/BIG5/Makefile
+++ b/share/i18n/esdb/BIG5/Makefile
@@ -13,12 +13,10 @@ Big5_$i_variable!= sed \
${.CURDIR}/Big5.variable
.endfor
.for i in ${PART}
-.if !exists(Big5-${i:S/:/@/}.src)
# XXX: FIXME
Big5-${i:S/:/@/}.src: Big5.src Big5.variable
sed -e 's/encoding/Big5-$i/' \
-e 's/variable/${Big5_$i_variable}/' \
${.CURDIR}/Big5.src > $@
- @echo Big5-${i:S/:/@/}.src >>.tmpfiles
-.endif
+ @echo ${.TARGET} >>.tmpfiles
.endfor
diff --git a/share/i18n/esdb/Makefile.part b/share/i18n/esdb/Makefile.part
index 60048c2..8de4045 100644
--- a/share/i18n/esdb/Makefile.part
+++ b/share/i18n/esdb/Makefile.part
@@ -60,16 +60,16 @@ esdb.alias.${ESUBDIR}: ${PARTFILE} ${ALIASFILE}
.endfor
echo >>${.TARGET}
+.if !defined(_SKIP_BUILD)
all: esdb.dir.${ESUBDIR} esdb.alias.${ESUBDIR} codesets
+.endif
codesets: ${ESDB}
.if !defined(NO_PREPROC)
.for i in ${PART}
-.if !exists(${EPREFIX}${i:S/:/@/}.src)
${EPREFIX}${i:S/:/@/}.src: ${CODE}.src
- sed ${SED_EXP:S@%%PART%%@${i}@} ${.CURDIR}/${CODE}.src > ${EPREFIX}${i:S/:/@/}.src
- @echo ${EPREFIX}${i:S/:/@/}.src >>.tmpfiles
-.endif
+ sed ${SED_EXP:S@%%PART%%@${i}@} ${.ALLSRC} > ${.TARGET}
+ @echo ${.TARGET} >>.tmpfiles
.endfor
.endif
diff --git a/share/i18n/esdb/UTF/Makefile b/share/i18n/esdb/UTF/Makefile
index 92ddcdd..a8e21ef 100644
--- a/share/i18n/esdb/UTF/Makefile
+++ b/share/i18n/esdb/UTF/Makefile
@@ -36,6 +36,6 @@ ${EPREFIX}${i}.src: ${CODE}.src
sed -e 's/UTF-x/UTF-${i}/' \
-e 's/UTF-mod/${UTF-${i}-mod}/' \
-e 's/UTF-var/${UTF-${i}-var}/' \
- ${.CURDIR}/${CODE}.src > ${EPREFIX}${i:S/:/@/}.src
- @echo ${EPREFIX}${i:S/:/@/}.src >>.tmpfiles
+ ${.ALLSRC} > ${.TARGET}
+ @echo ${.TARGET} >>.tmpfiles
.endfor
diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5
index 62c288b..b6d9bb4 100644
--- a/share/man/man5/src.conf.5
+++ b/share/man/man5/src.conf.5
@@ -1,7 +1,7 @@
.\" DO NOT EDIT-- this file is automatically generated.
.\" from FreeBSD: head/tools/build/options/makeman 292283 2015-12-15 18:42:30Z bdrewery
.\" $FreeBSD$
-.Dd March 1, 2016
+.Dd March 11, 2016
.Dt SRC.CONF 5
.Os
.Sh NAME
@@ -618,14 +618,12 @@ An alternate bootstrap tool chain must be provided.
.\" from FreeBSD: head/tools/build/options/WITHOUT_EXAMPLES 156938 2006-03-21 09:06:24Z ru
Set to avoid installing examples to
.Pa /usr/share/examples/ .
-.It Va WITH_FAST_DEPEND
-.\" from FreeBSD: head/tools/build/options/WITH_FAST_DEPEND 290433 2015-11-06 04:45:29Z bdrewery
-Set to generate
-.Sy .depend
-files in the build during compilation instead of the
-historial
+.It Va WITHOUT_FAST_DEPEND
+.\" from FreeBSD: head/tools/build/options/WITHOUT_FAST_DEPEND 296669 2016-03-11 17:00:42Z bdrewery
+Set to use the historical
.Xr mkdep 1
-call during the "make depend" phase.
+for the "make depend" phase of the build.
+This option is deprecated and will be removed soon.
.It Va WITHOUT_FDT
.\" from FreeBSD: head/tools/build/options/WITHOUT_FDT 221539 2011-05-06 19:10:27Z ru
Set to not build Flattened Device Tree support as part of the base system.
diff --git a/share/man/man9/sx.9 b/share/man/man9/sx.9
index 49a064e..a9931a9 100644
--- a/share/man/man9/sx.9
+++ b/share/man/man9/sx.9
@@ -26,7 +26,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd December 13, 2014
+.Dd March 13, 2016
.Dt SX 9
.Os
.Sh NAME
@@ -124,12 +124,10 @@ specifies a set of optional flags to alter the behavior of
It contains one or more of the following flags:
.Bl -tag -width SX_NOADAPTIVE
.It Dv SX_NOADAPTIVE
-If the kernel is not compiled with
-.Cd "options NO_ADAPTIVE_SX" ,
-then lock operations for
-.Fa sx
-will spin instead of sleeping while an exclusive lock holder is executing on
-another CPU.
+Disable adaptive spinning, rather than sleeping, for lock operations
+while an exclusive lock holder is executing on another CPU.
+Adaptive spinning is the default unless the kernel is compiled with
+.Cd "options NO_ADAPTIVE_SX" .
.It Dv SX_DUPOK
Witness should not log messages about duplicate locks being acquired.
.It Dv SX_NOWITNESS
diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk
index 19ab9e5..92c10a4 100644
--- a/share/mk/bsd.dep.mk
+++ b/share/mk/bsd.dep.mk
@@ -176,7 +176,9 @@ ${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$//}
_meta_filemon= 1
.endif
.if ${MK_FAST_DEPEND} == "yes"
+.if ${MAKE_VERSION} < 20160220
DEPEND_MP?= -MP
+.endif
# Handle OBJS=../somefile.o hacks. Just replace '/' rather than use :T to
# avoid collisions.
DEPEND_FILTER= C,/,_,g
@@ -200,7 +202,11 @@ CFLAGS+= ${DEPEND_CFLAGS}
.endif
.if !defined(_SKIP_READ_DEPEND)
.for __depend_obj in ${DEPENDFILES_OBJS}
+.if ${MAKE_VERSION} < 20160220
.sinclude "${.OBJDIR}/${__depend_obj}"
+.else
+.dinclude "${.OBJDIR}/${__depend_obj}"
+.endif
.endfor
.endif # !defined(_SKIP_READ_DEPEND)
.endif # !defined(_meta_filemon)
diff --git a/share/mk/bsd.files.mk b/share/mk/bsd.files.mk
index d4fd509..fa395f8 100644
--- a/share/mk/bsd.files.mk
+++ b/share/mk/bsd.files.mk
@@ -30,9 +30,7 @@ ${group}OWN?= ${SHAREOWN}
${group}GRP?= ${SHAREGRP}
${group}MODE?= ${SHAREMODE}
${group}DIR?= ${BINDIR}
-.if !make(buildincludes)
STAGE_SETS+= ${group}
-.endif
STAGE_DIR.${group}= ${STAGE_OBJTOP}${${group}DIR}
.if defined(NO_ROOT)
@@ -57,9 +55,7 @@ ${group}NAME_${file:T}?= ${${group}NAME}
.else
${group}NAME_${file:T}?= ${file:T}
.endif
-.if !make(buildincludes)
STAGE_AS_SETS+= ${file:T}
-.endif
STAGE_AS_${file:T}= ${${group}NAME_${file:T}}
# XXX {group}OWN,GRP,MODE
STAGE_DIR.${file:T}= ${STAGE_OBJTOP}${${group}DIR_${file:T}}
diff --git a/share/mk/bsd.opts.mk b/share/mk/bsd.opts.mk
index b073782..0fae155 100644
--- a/share/mk/bsd.opts.mk
+++ b/share/mk/bsd.opts.mk
@@ -52,6 +52,7 @@ __DEFAULT_YES_OPTIONS = \
ASSERT_DEBUG \
DEBUG_FILES \
DOCCOMPRESS \
+ FAST_DEPEND \
INCLUDES \
INSTALLLIB \
KERBEROS \
@@ -68,7 +69,6 @@ __DEFAULT_YES_OPTIONS = \
__DEFAULT_NO_OPTIONS = \
CCACHE_BUILD \
- FAST_DEPEND \
CTF \
INSTALL_AS_USER \
STALE_STAGED
diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk
index 290f894..fa6c6d4 100644
--- a/share/mk/bsd.subdir.mk
+++ b/share/mk/bsd.subdir.mk
@@ -131,7 +131,8 @@ ${SUBDIR:N.WAIT}: .PHONY .MAKE
# such as 'install' becoming {before,real,after}install, just recurse
# 'install'. Despite that, 'realinstall' is special due to ordering issues
# with 'afterinstall'.
-.if make(${__target}) || (${__target} == realinstall && make(install))
+.if !defined(NO_SUBDIR) && (make(${__target}) || \
+ (${__target} == realinstall && make(install)))
# Can ordering be skipped for this and SUBDIR_PARALLEL forced?
.if ${STANDALONE_SUBDIR_TARGETS:M${__target}}
_is_standalone_target= 1
@@ -153,12 +154,10 @@ __deps+= ${__target}_subdir_${DIRPRFX}${__dep}
.endfor
.endif
${__target}_subdir_${DIRPRFX}${__dir}: .PHONY .MAKE .SILENT ${__deps}
-.if !defined(NO_SUBDIR)
@${_+_}target=${__target:realinstall=install}; \
dir=${__dir}; \
${_SUBDIR_SH};
.endif
-.endif
.endfor # __dir in ${SUBDIR}
${__target}: ${__subdir_targets}
.else
diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk
index be4c52f..cf53d86 100644
--- a/share/mk/bsd.sys.mk
+++ b/share/mk/bsd.sys.mk
@@ -197,8 +197,9 @@ staging stage_libs stage_files stage_as stage_links stage_symlinks:
.else
# allow targets like beforeinstall to be leveraged
DESTDIR= ${STAGE_OBJTOP}
+.export DESTDIR
-.if commands(beforeinstall)
+.if target(beforeinstall)
.if !empty(_LIBS) || (${MK_STAGING_PROG} != "no" && !defined(INTERNALPROG))
staging: beforeinstall
.endif
diff --git a/share/mk/dirdeps.mk b/share/mk/dirdeps.mk
index a989f95..efc729c 100644
--- a/share/mk/dirdeps.mk
+++ b/share/mk/dirdeps.mk
@@ -1,5 +1,5 @@
# $FreeBSD$
-# $Id: dirdeps.mk,v 1.55 2015/10/20 22:04:53 sjg Exp $
+# $Id: dirdeps.mk,v 1.59 2016/02/26 23:32:29 sjg Exp $
# Copyright (c) 2010-2013, Juniper Networks, Inc.
# All rights reserved.
@@ -122,6 +122,9 @@ _DIRDEP_USE_LEVEL?= 0
# and non-specific Makefile.depend*
.if !target(_DIRDEP_USE)
+# make sure we get the behavior we expect
+.MAKE.SAVE_DOLLARS = no
+
# do some setup we only need once
_CURDIR ?= ${.CURDIR}
_OBJDIR ?= ${.OBJDIR}
@@ -257,11 +260,8 @@ DEP_RELDIR := ${DIRDEPS:R:[1]}
MK_DIRDEPS_CACHE = no
.endif
-
-# pickup customizations
-# as below you can use !target(_DIRDEP_USE) to protect things
-# which should only be done once.
-.-include "local.dirdeps.mk"
+# reset each time through
+_build_all_dirs =
# the first time we are included the _DIRDEP_USE target will not be defined
# we can use this as a clue to do initialization and other one time things.
@@ -281,6 +281,14 @@ DEBUG_DIRDEPS ?= no
# remember the initial value of DEP_RELDIR - we test for it below.
_DEP_RELDIR := ${DEP_RELDIR}
+.endif
+
+# pickup customizations
+# as below you can use !target(_DIRDEP_USE) to protect things
+# which should only be done once.
+.-include "local.dirdeps.mk"
+
+.if !target(_DIRDEP_USE)
# things we skip for host tools
SKIP_HOSTDIR ?=
@@ -400,6 +408,7 @@ ${DIRDEPS_CACHE}: .META .NOMETA_CMP
MAKEFLAGS= ${.MAKE} -C ${_CURDIR} -f ${BUILD_DIRDEPS_MAKEFILE} \
${BUILD_DIRDEPS_TARGETS} BUILD_DIRDEPS_CACHE=yes \
.MAKE.DEPENDFILE=.none \
+ ${.MAKEFLAGS:tW:S,-D ,-D,g:tw:M*WITH*} \
3>&1 1>&2 | sed 's,${SRCTOP},$${SRCTOP},g' >> ${.TARGET}.new && \
mv ${.TARGET}.new ${.TARGET}
@@ -480,7 +489,11 @@ _build_dirs += ${_machines:@m@${_CURDIR}.$m@}
_build_dirs += ${_machines:N${DEP_TARGET_SPEC}:@m@${_CURDIR}.$m@}
.if ${DEP_TARGET_SPEC} == ${TARGET_SPEC}
# pickup local dependencies now
+.if ${MAKE_VERSION} < 20160220
.-include <.depend>
+.else
+.dinclude <.depend>
+.endif
.endif
.endif
.endif
@@ -532,22 +545,25 @@ _build_dirs += \
# qualify everything now
_build_dirs := ${_build_dirs:${M_dep_qual_fixes:ts:}:O:u}
+_build_all_dirs += ${_build_dirs}
+_build_all_dirs := ${_build_all_dirs:O:u}
+
.endif # empty DIRDEPS
# Normally if doing make -V something,
# we do not want to waste time chasing DIRDEPS
# but if we want to count the number of Makefile.depend* read, we do.
.if ${.MAKEFLAGS:M-V${_V_READ_DIRDEPS}} == ""
-.if !empty(_build_dirs)
+.if !empty(_build_all_dirs)
.if ${BUILD_DIRDEPS_CACHE} == "yes"
x!= { echo; echo '\# ${DEP_RELDIR}.${DEP_TARGET_SPEC}'; \
- echo 'dirdeps: ${_build_dirs:${M_oneperline}}'; echo; } >&3; echo
-x!= { ${_build_dirs:@x@${target($x):?:echo '$x: _DIRDEP_USE';}@} echo; } >&3; echo
+ echo 'dirdeps: ${_build_all_dirs:${M_oneperline}}'; echo; } >&3; echo
+x!= { ${_build_all_dirs:@x@${target($x):?:echo '$x: _DIRDEP_USE';}@} echo; } >&3; echo
.else
# this makes it all happen
-dirdeps: ${_build_dirs}
+dirdeps: ${_build_all_dirs}
.endif
-${_build_dirs}: _DIRDEP_USE
+${_build_all_dirs}: _DIRDEP_USE
.if ${_debug_reldir}
.info ${DEP_RELDIR}.${DEP_TARGET_SPEC}: needs: ${_build_dirs}
@@ -581,14 +597,14 @@ ${_this_dir}.$m: ${_build_dirs:M*.$m:N${_this_dir}.$m}
.endif
# Now find more dependencies - and recurse.
-.for d in ${_build_dirs}
+.for d in ${_build_all_dirs}
.if ${_DIRDEP_CHECKED:M$d} == ""
# once only
_DIRDEP_CHECKED += $d
.if ${_debug_search}
.info checking $d
.endif
-# Note: _build_dirs is fully qualifed so d:R is always the directory
+# Note: _build_all_dirs is fully qualifed so d:R is always the directory
.if exists(${d:R})
# Warning: there is an assumption here that MACHINE is always
# the first entry in TARGET_SPEC_VARS.
@@ -628,28 +644,37 @@ DIRDEPS =
DEP_RELDIR := ${RELDIR}
_DEP_RELDIR := ${RELDIR}
# pickup local dependencies
+.if ${MAKE_VERSION} < 20160220
.-include <.depend>
+.else
+.dinclude <.depend>
+.endif
.endif
# bootstrapping new dependencies made easy?
-.if (make(bootstrap) || make(bootstrap-recurse)) && !target(bootstrap)
+.if !target(bootstrap) && (make(bootstrap) || \
+ make(bootstrap-this) || \
+ make(bootstrap-recurse) || \
+ make(bootstrap-empty))
.if exists(${.CURDIR}/${.MAKE.DEPENDFILE:T})
# stop here
${.TARGETS:Mboot*}:
-.else
+.elif !make(bootstrap-empty)
# find a Makefile.depend to use as _src
_src != cd ${.CURDIR} && for m in ${.MAKE.DEPENDFILE_PREFERENCE:T:S,${MACHINE},*,}; do test -s $$m || continue; echo $$m; break; done; echo
.if empty(_src)
-.error cannot find any of ${.MAKE.DEPENDFILE_PREFERENCE:T}
+.error cannot find any of ${.MAKE.DEPENDFILE_PREFERENCE:T}${.newline}Use: bootstrap-empty
.endif
_src?= ${.MAKE.DEPENDFILE:T}
+# just create Makefile.depend* for this dir
bootstrap-this: .NOTMAIN
@echo Bootstrapping ${RELDIR}/${.MAKE.DEPENDFILE:T} from ${_src:T}
(cd ${.CURDIR} && sed 's,${_src:E},${MACHINE},g' ${_src} > ${.MAKE.DEPENDFILE:T})
+# create Makefile.depend* for this dir and its dependencies
bootstrap: bootstrap-recurse
bootstrap-recurse: bootstrap-this
@@ -664,4 +689,11 @@ bootstrap-recurse: .NOTMAIN .MAKE
done
.endif
+
+# create an empty Makefile.depend* to get the ball rolling.
+bootstrap-empty: .NOTMAIN .NOMETA
+ @echo Creating empty ${RELDIR}/${.MAKE.DEPENDFILE:T}; \
+ echo You need to build ${RELDIR} to correctly populate it.
+ @{ echo DIRDEPS=; echo ".include <dirdeps.mk>"; } > ${.CURDIR}/${.MAKE.DEPENDFILE:T}
+
.endif
diff --git a/share/mk/gendirdeps.mk b/share/mk/gendirdeps.mk
index b4d1386..cacb570 100644
--- a/share/mk/gendirdeps.mk
+++ b/share/mk/gendirdeps.mk
@@ -1,5 +1,5 @@
# $FreeBSD$
-# $Id: gendirdeps.mk,v 1.29 2015/10/03 05:00:46 sjg Exp $
+# $Id: gendirdeps.mk,v 1.30 2016/02/27 00:20:39 sjg Exp $
# Copyright (c) 2010-2013, Juniper Networks, Inc.
# All rights reserved.
@@ -310,7 +310,7 @@ 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.
-${_DEPENDFILE}: ${CAT_DEPEND:M.depend} ${META_FILES:O:u:@m@${exists($m):?$m:}@} ${_this} ${META2DEPS}
+${_DEPENDFILE}: .NOMETA ${CAT_DEPEND:M.depend} ${META_FILES:O:u:@m@${exists($m):?$m:}@} ${_this} ${META2DEPS}
@(${GENDIRDEPS_HEADER} echo '# Autogenerated - do NOT edit!'; echo; \
echo 'DIRDEPS = \'; \
echo '${DIRDEPS:@d@ $d \\${.newline}@}'; echo; \
@@ -330,7 +330,7 @@ DIRDEPS := ${SUBDIR:S,^,${RELDIR}/,:O:u}
all: ${_DEPENDFILE}
-${_DEPENDFILE}: ${MAKEFILE} ${_this}
+${_DEPENDFILE}: .NOMETA ${MAKEFILE} ${_this}
@(${GENDIRDEPS_HEADER} echo '# Autogenerated - do NOT edit!'; echo; \
echo 'DIRDEPS = \'; \
echo '${DIRDEPS:@d@ $d \\${.newline}@}'; echo; \
diff --git a/share/mk/local.meta.sys.mk b/share/mk/local.meta.sys.mk
index 9f000f5..14bfb64 100644
--- a/share/mk/local.meta.sys.mk
+++ b/share/mk/local.meta.sys.mk
@@ -132,6 +132,16 @@ PYTHON ?= /usr/local/bin/python
.export PYTHON
# this works best if share/mk is ready for it.
BUILD_AT_LEVEL0= no
+# _SKIP_BUILD is not 100% as it requires wrapping all 'all:' targets to avoid
+# building in MAKELEVEL0. Just prohibit 'all' entirely in this case to avoid
+# problems.
+.if ${MK_DIRDEPS_BUILD} == "yes" && \
+ ${.MAKE.LEVEL} == 0 && ${BUILD_AT_LEVEL0:Uyes:tl} == "no"
+.MAIN: dirdeps
+.if make(all)
+.error DIRDEPS_BUILD: Please run '${MAKE}' instead of '${MAKE} all'.
+.endif
+.endif
# we want to end up with a singe stage tree for all machines
.if ${MK_STAGING} == "yes"
@@ -236,8 +246,7 @@ PATH:= ${TOOLSDIR}${dir}:${PATH}
_toolchain_bin.${var}= ${TOOLSDIR}${_toolchain_bin_${var}:U/usr/bin/${var:tl}}
.if exists(${_toolchain_bin.${var}})
HOST_${var}?= ${_toolchain_bin.${var}}
-${var}?= ${HOST_${var}}
-.export HOST_${var} ${var}
+.export HOST_${var}
.endif
.endfor
.endif
diff --git a/share/mk/local.sys.mk b/share/mk/local.sys.mk
index c1baee5..ae022a1 100644
--- a/share/mk/local.sys.mk
+++ b/share/mk/local.sys.mk
@@ -27,12 +27,26 @@ MAKE_PRINT_VAR_ON_ERROR += .MAKE.MAKEFILES .PATH
.if ${.MAKE.MODE:Mmeta*} != ""
# we can afford to use cookies to prevent some targets
-# re-running needlessly
-META_COOKIE_TOUCH= touch ${COOKIE.${.TARGET}:U${.OBJDIR}/${.TARGET}}
-# some targets need to be .PHONY - but not in meta mode
-META_NOPHONY=
+# re-running needlessly but only when using filemon.
+.if ${.MAKE.MODE:Mnofilemon} == ""
+META_COOKIE= ${COOKIE.${.TARGET}:U${.OBJDIR}/${.TARGET}}
+META_COOKIE_RM= @rm -f ${META_COOKIE}
+META_COOKIE_TOUCH= @touch ${META_COOKIE}
+CLEANFILES+= ${META_TARGETS}
+_meta_dep_before: .USEBEFORE .NOTMAIN
+ ${META_COOKIE_RM}
+_meta_dep_after: .USE .NOTMAIN
+ ${META_COOKIE_TOUCH}
+# Attach this to a target to allow it to benefit from meta mode's
+# not rerunning a command if it doesn't need to be considering its
+# metafile/filemon-tracked dependencies.
+META_DEPS= _meta_dep_before _meta_dep_after .META
+.endif
.else
-META_COOKIE_TOUCH=
-META_NOPHONY= .PHONY
+# some targets need to be .PHONY - but not in meta mode
+META_NOPHONY= .PHONY
.endif
-
+META_NOPHONY?=
+META_COOKIE_RM?=
+META_COOKIE_TOUCH?=
+META_DEPS+= ${META_NOPHONY}
diff --git a/share/mk/meta.autodep.mk b/share/mk/meta.autodep.mk
index aa41c6e..ac0c408 100644
--- a/share/mk/meta.autodep.mk
+++ b/share/mk/meta.autodep.mk
@@ -1,5 +1,5 @@
# $FreeBSD$
-# $Id: meta.autodep.mk,v 1.36 2014/08/02 23:10:29 sjg Exp $
+# $Id: meta.autodep.mk,v 1.40 2016/02/22 22:44:58 sjg Exp $
#
# @(#) Copyright (c) 2010, Simon J. Gerraty
@@ -87,7 +87,7 @@ WANT_UPDATE_DEPENDFILE ?= yes
.endif
.if ${WANT_UPDATE_DEPENDFILE:Uno:tl} != "no"
-.if ${.MAKE.MODE:Mmeta*} == "" || ${.MAKE.MODE:M*read*} != ""
+.if ${.MAKE.MODE:Uno:Mmeta*} == "" || ${.MAKE.MODE:Uno:M*read*} != ""
UPDATE_DEPENDFILE = no
.endif
diff --git a/share/mk/meta.stage.mk b/share/mk/meta.stage.mk
index 0f5f37d..e315828 100644
--- a/share/mk/meta.stage.mk
+++ b/share/mk/meta.stage.mk
@@ -1,5 +1,5 @@
# $FreeBSD$
-# $Id: meta.stage.mk,v 1.35 2015/05/20 06:40:33 sjg Exp $
+# $Id: meta.stage.mk,v 1.43 2016/02/24 18:46:32 sjg Exp $
#
# @(#) Copyright (c) 2011, Simon J. Gerraty
#
@@ -27,7 +27,7 @@ _dirdep = ${RELDIR}
CLEANFILES+= .dirdep
# this allows us to trace dependencies back to their src dir
-.dirdep:
+.dirdep: .NOPATH
@echo '${_dirdep}' > $@
.if defined(NO_POSIX_SHELL) || ${type printf:L:sh:Mbuiltin} == ""
@@ -242,7 +242,7 @@ CLEANFILES += ${STAGE_TARGETS} stage_incs stage_includes
# for non-jobs mode the order here matters
staging: ${STAGE_TARGETS:N*_links} ${STAGE_TARGETS:M*_links}
-.if ${.MAKE.JOBS:U0} > 0 && ${STAGE_TARGETS:M*_links} != ""
+.if ${.MAKE.JOBS:U0} > 0 && ${STAGE_TARGETS:U:M*_links} != ""
# the above isn't sufficient
.for t in ${STAGE_TARGETS:N*links:O:u}
.ORDER: $t stage_links
diff --git a/share/mk/meta.sys.mk b/share/mk/meta.sys.mk
index 8a42b6c..5c68c88 100644
--- a/share/mk/meta.sys.mk
+++ b/share/mk/meta.sys.mk
@@ -111,7 +111,7 @@ _metaError: .NOMETA .NOTMAIN
.endif
# Are we, after all, in meta mode?
-.if ${.MAKE.MODE:Mmeta*} != ""
+.if ${.MAKE.MODE:Uno:Mmeta*} != ""
MKDEP_MK = meta.autodep.mk
# if we think we are updating dependencies,
diff --git a/share/mk/sys.dependfile.mk b/share/mk/sys.dependfile.mk
index d12d939..745873f 100644
--- a/share/mk/sys.dependfile.mk
+++ b/share/mk/sys.dependfile.mk
@@ -1,5 +1,5 @@
# $FreeBSD$
-# $Id: sys.dependfile.mk,v 1.6 2014/08/02 18:02:06 sjg Exp $
+# $Id: sys.dependfile.mk,v 1.7 2016/02/20 01:57:39 sjg Exp $
#
# @(#) Copyright (c) 2012, Simon J. Gerraty
#
@@ -49,8 +49,10 @@ _e := ${.MAKE.DEPENDFILE_PREFERENCE:@m@${exists($m):?$m:}@}
# MACHINE specific depend files are supported, but *not* default.
# If any already exist, we should follow suit.
_aml = ${ALL_MACHINE_LIST:Uarm amd64 i386 powerpc:N${MACHINE}} ${MACHINE}
-# MACHINE must be the last entry in _aml ;-)
+# make sure we restore MACHINE
+_m := ${MACHINE}
_e := ${_aml:@MACHINE@${.MAKE.DEPENDFILE_PREFERENCE:@m@${exists($m):?$m:}@}@}
+MACHINE := ${_m}
.if !empty(_e)
.MAKE.DEPENDFILE ?= ${.MAKE.DEPENDFILE_PREFERENCE:M*${MACHINE}:[1]}
.endif
diff --git a/share/sendmail/Makefile b/share/sendmail/Makefile
index 0e1a27d..2b1ae07 100644
--- a/share/sendmail/Makefile
+++ b/share/sendmail/Makefile
@@ -17,8 +17,9 @@ SHARED?= copies
all clean cleandir depend lint tags:
beforeinstall: ${SHARED}
+META_TARGETS+= copies symlinks
-copies::
+copies: ${META_DEPS}
if [ -L ${DDIR}/${CFDIR} ]; then rm -f ${DDIR}/${CFDIR}; fi
.for dir in ${CFDIRS}
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 -d ${DDIR}/${dir}
@@ -27,7 +28,7 @@ copies::
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 ${SENDMAIL_DIR}/${file} ${DDIR}/${file}
.endfor
-symlinks::
+symlinks: ${META_DEPS}
rm -rf ${DDIR}/${CFDIR}; ln -s ${SENDMAIL_DIR}/${CFDIR} ${DDIR}/${CFDIR}
.include <bsd.prog.mk>
diff --git a/share/sendmail/Makefile.depend b/share/sendmail/Makefile.depend
index f80275d..d7cfba0 100644
--- a/share/sendmail/Makefile.depend
+++ b/share/sendmail/Makefile.depend
@@ -2,6 +2,7 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/share/zoneinfo/Makefile b/share/zoneinfo/Makefile
index b3d968d..1ca7ea6 100644
--- a/share/zoneinfo/Makefile
+++ b/share/zoneinfo/Makefile
@@ -67,17 +67,20 @@ TZBUILDSUBDIRS= \
Pacific \
SystemV
+.if !defined(_SKIP_BUILD)
all: zoneinfo
+.endif
+META_TARGETS+= zoneinfo install-zoneinfo
-.PHONY: zoneinfo
-zoneinfo: yearistype ${TDATA}
+zoneinfo: yearistype ${TDATA} ${META_DEPS}
mkdir -p ${TZBUILDDIR}
cd ${TZBUILDDIR}; mkdir -p ${TZBUILDSUBDIRS}
umask 022; cd ${.CURDIR}; \
zic -D -d ${TZBUILDDIR} -p ${POSIXRULES} -m ${NOBINMODE} \
${LEAPFILE} -y ${.OBJDIR}/yearistype ${TZFILES}
-beforeinstall:
+beforeinstall: install-zoneinfo
+install-zoneinfo: ${META_DEPS}
cd ${TZBUILDDIR} && \
find -s * -type f -print -exec ${INSTALL} \
-o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
diff --git a/share/zoneinfo/Makefile.depend b/share/zoneinfo/Makefile.depend
index f80275d..d7cfba0 100644
--- a/share/zoneinfo/Makefile.depend
+++ b/share/zoneinfo/Makefile.depend
@@ -2,6 +2,7 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ usr.bin/xinstall.host \
.include <dirdeps.mk>
OpenPOWER on IntegriCloud