summaryrefslogtreecommitdiffstats
path: root/share/mk/bsd.port.subdir.mk
blob: 55a1a7e8d31996f3c96fe433aa382f8f20e96a61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# $FreeBSD$

.if !defined(PORTSDIR)
# Autodetect if the command is being run in a ports tree that's not rooted
# in the default /usr/ports.  The ../../.. case is in case ports ever grows
# a third level.
.if exists(${.CURDIR}/Mk/bsd.port.mk)
PORTSDIR!=	realpath ${.CURDIR}
.elif exists(${.CURDIR}/../Mk/bsd.port.mk)
PORTSDIR!=	realpath ${.CURDIR}/..
.elif exists(${.CURDIR}/../../Mk/bsd.port.mk)
PORTSDIR!=	realpath ${.CURDIR}/../..
.elif exists(${.CURDIR}/../../../Mk/bsd.port.mk)
PORTSDIR!=	realpath ${.CURDIR}/../../..
.else
PORTSDIR=	/usr/ports
.endif
.endif

BSDPORTSUBDIRMK?=	${PORTSDIR}/Mk/bsd.port.subdir.mk

.include "${BSDPORTSUBDIRMK}"
OpenPOWER on IntegriCloud