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 12.if defined(.PARSEDIR) 13PORTSDIR= ${_PORTSDIR:tA} 14.else # fmake doesn't have :tA 15PORTSDIR!= realpath ${_PORTSDIR} 16.endif 17.endif 18 19BSDPORTMK?= ${PORTSDIR}/Mk/bsd.port.mk 20 21# Needed to keep bsd.own.mk from reading in /etc/src.conf 22# and setting MK_* variables when building ports. 23_WITHOUT_SRCCONF= 24 25# Enable CTF conversion on request. 26.if defined(WITH_CTF) 27.undef NO_CTF 28.endif 29 30.include <bsd.own.mk> 31.include "${BSDPORTMK}" 32