4 # Autodetect if the command is being run in a ports tree that's not rooted
5 # in the default /usr/ports. The ../../.. case is in case ports ever grows
7 .for RELPATH in . .. ../.. ../../..
8 .if !defined(_PORTSDIR) && exists(${.CURDIR}/${RELPATH}/Mk/bsd.port.mk)
9 _PORTSDIR= ${.CURDIR}/${RELPATH}
12 _PORTSDIR?= /usr/ports
13 PORTSDIR!= realpath ${_PORTSDIR}
16 BSDPORTMK?= ${PORTSDIR}/Mk/bsd.port.mk
18 # Needed to keep bsd.own.mk from reading in /etc/src.conf
19 # and setting MK_* variables when building ports.
22 # Enable CTF conversion on request.
28 .include "${BSDPORTMK}"