]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/mk/src.sys.env.mk
MFV r329718: 8520 7198 lzc_rollback_to should support rolling back to origin
[FreeBSD/FreeBSD.git] / share / mk / src.sys.env.mk
1 # $FreeBSD$
2
3 # early setup only see also src.sys.mk
4
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
8 # absolute path.
9 .if ${MAKE_VERSION} >= 20170301 && !empty(.CURDIR:M/*)
10 .CURDIR:= ${.CURDIR:tA}
11 .endif
12
13 # make sure this is defined in a consistent manner
14 SRCTOP:= ${.PARSEDIR:tA:H:H}
15
16 .if ${.CURDIR} == ${SRCTOP}
17 RELDIR= .
18 RELTOP= .
19 .elif ${.CURDIR:M${SRCTOP}/*}
20 RELDIR:= ${.CURDIR:S,${SRCTOP}/,,}
21 .endif
22 RELTOP?=        ${RELDIR:C,[^/]+,..,g}
23 RELOBJTOP?=     ${RELTOP}
24 RELSRCTOP?=     ${RELTOP}
25
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
31 .endif
32
33 .include <bsd.mkopt.mk>
34
35 # Top-level installs should not use meta mode as it may prevent installing
36 # based on cookies.
37 .if make(*install*) && ${.MAKE.LEVEL} == 0
38 META_MODE=      normal
39 MK_META_MODE=   no
40 .export MK_META_MODE
41 .endif
42
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},}
48 .endif
49 .if ${MAKESYSPATH:Uno:M*.../*} != ""
50 MAKESYSPATH:= ${MAKESYSPATH:S,.../share/mk,${.PARSEDIR:tA},}
51 .export MAKESYSPATH
52 .elif empty(MAKESYSPATH)
53 MAKESYSPATH:=   ${.PARSEDIR:tA}
54 .export MAKESYSPATH
55 .endif
56
57 .if ${RELDIR:U} == "." && ${.MAKE.LEVEL} == 0
58 .sinclude "${.CURDIR}/Makefile.sys.inc"
59 .endif
60 .include <src.sys.obj.mk>