xref: /freebsd/share/mk/src.sys.env.mk (revision 93e779a26c651610ac6e7986d67ecc9ed2cadcbf)
1# $FreeBSD$
2
3# early setup only see also src.sys.mk
4
5# make sure this is defined in a consistent manner
6SRCTOP:= ${.PARSEDIR:tA:H:H}
7
8.if ${.CURDIR} == ${SRCTOP}
9RELDIR = .
10.elif ${.CURDIR:M${SRCTOP}/*}
11RELDIR := ${.CURDIR:S,${SRCTOP}/,,}
12.endif
13
14# site customizations that do not depend on anything!
15SRC_ENV_CONF?= /etc/src-env.conf
16.if !empty(SRC_ENV_CONF) && !target(_src_env_conf_included_)
17.-include "${SRC_ENV_CONF}"
18_src_env_conf_included_:	.NOTMAIN
19.endif
20
21# If we were found via .../share/mk we need to replace that
22# with ${.PARSEDIR:tA} so that we can be found by
23# sub-makes launched from objdir.
24.if ${.MAKEFLAGS:M.../share/mk} != ""
25.MAKEFLAGS:= ${.MAKEFLAGS:S,.../share/mk,${.PARSEDIR:tA},}
26.endif
27.if ${MAKESYSPATH:Uno:M*.../*} != ""
28MAKESYSPATH:= ${MAKESYSPATH:S,.../share/mk,${.PARSEDIR:tA},}
29.export MAKESYSPATH
30.endif
31