Add SRCTOP and RELDIR support.

This is a direct commit to stable/10.  It allows simpler MFCing from head where
these are being used more frequently.

Sponsored by:	EMC / Isilon Storage Division
This commit is contained in:
bdrewery 2015-12-15 01:19:19 +00:00
parent c6b624d1a1
commit 54d1dbbb2e

13
share/mk/local.sys.mk Normal file
View File

@ -0,0 +1,13 @@
# $FreeBSD$
.if defined(.PARSEDIR)
SRCTOP:= ${.PARSEDIR:tA:H:H}
.else
SRCTOP:= ${.MAKE.MAKEFILES:M*/local.sys.mk:H:H:H}
.endif
.if ${.CURDIR} == ${SRCTOP}
RELDIR = .
.elif ${.CURDIR:M${SRCTOP}/*}
RELDIR := ${.CURDIR:S,${SRCTOP}/,,}
.endif