2015-06-19 14:56:24 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
# early setup only see also src.sys.mk
|
|
|
|
|
2017-12-05 21:30:22 +00:00
|
|
|
# bmake-20170301 started taking '-C' "as is" for some cases, notably absolute
|
|
|
|
# paths. Some later comparisons will assume .CURDIR is resolved and matches
|
|
|
|
# what we would get with 'cd'. So just force resolve it now if it is an
|
|
|
|
# absolute path.
|
|
|
|
.if ${MAKE_VERSION} >= 20170301 && !empty(.CURDIR:M/*)
|
|
|
|
.CURDIR:= ${.CURDIR:tA}
|
|
|
|
.endif
|
|
|
|
|
2015-06-19 14:56:24 +00:00
|
|
|
# make sure this is defined in a consistent manner
|
|
|
|
SRCTOP:= ${.PARSEDIR:tA:H:H}
|
|
|
|
|
2015-09-23 23:30:57 +00:00
|
|
|
.if ${.CURDIR} == ${SRCTOP}
|
2017-10-31 00:07:41 +00:00
|
|
|
RELDIR= .
|
|
|
|
RELTOP= .
|
2015-09-23 23:30:57 +00:00
|
|
|
.elif ${.CURDIR:M${SRCTOP}/*}
|
2017-10-31 00:07:41 +00:00
|
|
|
RELDIR:= ${.CURDIR:S,${SRCTOP}/,,}
|
2015-09-23 23:30:57 +00:00
|
|
|
.endif
|
2017-10-31 00:07:41 +00:00
|
|
|
RELTOP?= ${RELDIR:C,[^/]+,..,g}
|
|
|
|
RELOBJTOP?= ${RELTOP}
|
|
|
|
RELSRCTOP?= ${RELTOP}
|
2015-09-23 23:30:57 +00:00
|
|
|
|
2022-05-03 11:09:38 +00:00
|
|
|
.if !defined(OS_REVISION)
|
|
|
|
OS_REVISION!=eval `sh ${SRCTOP}/sys/conf/newvers.sh -V REVISION` && echo $$REVISION || echo
|
|
|
|
.export OS_REVISION
|
|
|
|
.endif
|
|
|
|
|
2015-06-19 14:56:24 +00:00
|
|
|
# site customizations that do not depend on anything!
|
2018-03-03 23:23:01 +00:00
|
|
|
|
|
|
|
# Save MAKEOBJDIRPREFIX and don't let src-env.conf modify it.
|
|
|
|
# MAKEOBJDIRPREFIX is only needed in MAKELEVEL=0. In sub-makes it will
|
|
|
|
# either be read from environment or OBJDIR/MAKEOBJDIR according to
|
|
|
|
# src.sys.obj.mk.
|
|
|
|
.if !(${.MAKE.LEVEL} == 0 || empty(OBJROOT))
|
|
|
|
.if defined(MAKEOBJDIRPREFIX)
|
|
|
|
_saveMAKEOBJDIRPREFIX:= ${MAKEOBJDIRPREFIX}
|
|
|
|
.else
|
|
|
|
_undefMAKEOBJDIRPREFIX= t
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
2022-12-07 19:30:35 +00:00
|
|
|
.-include <site.src.sys.env.mk>
|
|
|
|
|
2015-06-19 14:56:24 +00:00
|
|
|
SRC_ENV_CONF?= /etc/src-env.conf
|
|
|
|
.if !empty(SRC_ENV_CONF) && !target(_src_env_conf_included_)
|
|
|
|
.-include "${SRC_ENV_CONF}"
|
|
|
|
_src_env_conf_included_: .NOTMAIN
|
|
|
|
.endif
|
|
|
|
|
2018-03-03 23:23:01 +00:00
|
|
|
.if defined(_saveMAKEOBJDIRPREFIX) || defined(_undefMAKEOBJDIRPREFIX)
|
|
|
|
.if defined(MAKEOBJDIRPREFIX) && ((defined(_saveMAKEOBJDIRPREFIX) && \
|
|
|
|
${_saveMAKEOBJDIRPREFIX} != ${MAKEOBJDIRPREFIX}) || \
|
|
|
|
defined(_undefMAKEOBJDIRPREFIX))
|
|
|
|
.warning ${SRC_ENV_CONF}: Ignoring MAKEOBJDIRPREFIX entry in sub-make. Use '?=' to avoid this warning.
|
|
|
|
.endif
|
|
|
|
.if defined(_saveMAKEOBJDIRPREFIX)
|
|
|
|
MAKEOBJDIRPREFIX:= ${_saveMAKEOBJDIRPREFIX}
|
|
|
|
.undef _saveMAKEOBJDIRPREFIX
|
|
|
|
.elif defined(_undefMAKEOBJDIRPREFIX)
|
|
|
|
.undef MAKEOBJDIRPREFIX
|
|
|
|
.undef _undefMAKEOBJDIRPREFIX
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
2017-11-18 20:10:36 +00:00
|
|
|
.include <bsd.mkopt.mk>
|
|
|
|
|
2016-05-21 01:31:54 +00:00
|
|
|
# Top-level installs should not use meta mode as it may prevent installing
|
2020-01-17 14:29:27 +00:00
|
|
|
# based on cookies. It's fine with filemon though.
|
|
|
|
.if !empty(META_MODE:Mnofilemon) && \
|
|
|
|
make(*install*) && ${.MAKE.LEVEL} == 0
|
2016-05-21 01:31:54 +00:00
|
|
|
META_MODE= normal
|
|
|
|
MK_META_MODE= no
|
2016-08-25 23:55:56 +00:00
|
|
|
.export MK_META_MODE
|
2016-05-21 01:31:54 +00:00
|
|
|
.endif
|
|
|
|
|
2015-06-19 14:56:24 +00:00
|
|
|
# If we were found via .../share/mk we need to replace that
|
|
|
|
# with ${.PARSEDIR:tA} so that we can be found by
|
|
|
|
# sub-makes launched from objdir.
|
|
|
|
.if ${.MAKEFLAGS:M.../share/mk} != ""
|
|
|
|
.MAKEFLAGS:= ${.MAKEFLAGS:S,.../share/mk,${.PARSEDIR:tA},}
|
|
|
|
.endif
|
|
|
|
.if ${MAKESYSPATH:Uno:M*.../*} != ""
|
|
|
|
MAKESYSPATH:= ${MAKESYSPATH:S,.../share/mk,${.PARSEDIR:tA},}
|
|
|
|
.export MAKESYSPATH
|
2016-05-26 23:20:04 +00:00
|
|
|
.elif empty(MAKESYSPATH)
|
|
|
|
MAKESYSPATH:= ${.PARSEDIR:tA}
|
|
|
|
.export MAKESYSPATH
|
2015-06-19 14:56:24 +00:00
|
|
|
.endif
|
2017-11-01 21:22:05 +00:00
|
|
|
|
2017-11-18 20:01:09 +00:00
|
|
|
.if ${RELDIR:U} == "." && ${.MAKE.LEVEL} == 0
|
2022-12-07 19:30:35 +00:00
|
|
|
.-include "${.CURDIR}/Makefile.sys.inc"
|
2017-11-18 20:01:09 +00:00
|
|
|
.endif
|
2017-11-01 21:22:05 +00:00
|
|
|
.include <src.sys.obj.mk>
|