xref: /freebsd/share/mk/bsd.port.subdir.mk (revision e0c4386e7e71d93b0edc0c8fa156263fc4a8b0b6)
1
2.if !defined(PORTSDIR)
3# Autodetect if the command is being run in a ports tree that's not rooted
4# in the default /usr/ports.  The ../../.. case is in case ports ever grows
5# a third level.
6.for RELPATH in . .. ../.. ../../..
7.if !defined(_PORTSDIR) && exists(${.CURDIR}/${RELPATH}/Mk/bsd.port.mk)
8_PORTSDIR=	${.CURDIR}/${RELPATH}
9.endif
10.endfor
11_PORTSDIR?=	/usr/ports
12PORTSDIR=	${_PORTSDIR:tA}
13.endif
14
15BSDPORTSUBDIRMK?=	${PORTSDIR}/Mk/bsd.port.subdir.mk
16
17.include "${BSDPORTSUBDIRMK}"
18