3 # early setup only see also src.sys.mk
5 # bmake-20170301 started taking '-C' "as is" for some cases, notably absolute
6 # paths. Some later comparisons will assume .CURDIR is resolved and matches
7 # what we would get with 'cd'. So just force resolve it now if it is an
9 .if ${MAKE_VERSION} >= 20170301 && !empty(.CURDIR:M/*)
10 .CURDIR:= ${.CURDIR:tA}
13 # make sure this is defined in a consistent manner
14 SRCTOP:= ${.PARSEDIR:tA:H:H}
16 .if ${.CURDIR} == ${SRCTOP}
19 .elif ${.CURDIR:M${SRCTOP}/*}
20 RELDIR:= ${.CURDIR:S,${SRCTOP}/,,}
22 RELTOP?= ${RELDIR:C,[^/]+,..,g}
26 # site customizations that do not depend on anything!
27 SRC_ENV_CONF?= /etc/src-env.conf
28 .if !empty(SRC_ENV_CONF) && !target(_src_env_conf_included_)
29 .-include "${SRC_ENV_CONF}"
30 _src_env_conf_included_: .NOTMAIN
33 .include <bsd.mkopt.mk>
35 # Top-level installs should not use meta mode as it may prevent installing
37 .if make(*install*) && ${.MAKE.LEVEL} == 0
43 # If we were found via .../share/mk we need to replace that
44 # with ${.PARSEDIR:tA} so that we can be found by
45 # sub-makes launched from objdir.
46 .if ${.MAKEFLAGS:M.../share/mk} != ""
47 .MAKEFLAGS:= ${.MAKEFLAGS:S,.../share/mk,${.PARSEDIR:tA},}
49 .if ${MAKESYSPATH:Uno:M*.../*} != ""
50 MAKESYSPATH:= ${MAKESYSPATH:S,.../share/mk,${.PARSEDIR:tA},}
52 .elif empty(MAKESYSPATH)
53 MAKESYSPATH:= ${.PARSEDIR:tA}
57 .if ${RELDIR:U} == "." && ${.MAKE.LEVEL} == 0
58 .sinclude "${.CURDIR}/Makefile.sys.inc"
60 .include <src.sys.obj.mk>