Changeset View
Changeset View
Standalone View
Standalone View
share/mk/bsd.port.mk
# $FreeBSD$ | # $FreeBSD$ | ||||
PORTSDIR?= /usr/ports | .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 | |||||
bdrewery: At least use $${PWD} here. | |||||
# a third level. | |||||
.if exists(${.CURDIR}/Mk/bsd.port.mk) | |||||
Not Done Inline ActionsPerhaps to avoid POLA this should say "Using $$curdir for PORTSDIR" to stderr. bdrewery: Perhaps to avoid POLA this should say "Using $$curdir for PORTSDIR" to stderr. | |||||
PORTSDIR= ${.CURDIR} | |||||
.elif exists(${.CURDIR}/../Mk/bsd.port.mk) | |||||
PORTSDIR= ${.CURDIR}/.. | |||||
.elif exists(${.CURDIR}/../../Mk/bsd.port.mk) | |||||
PORTSDIR= ${.CURDIR}/../.. | |||||
.elif exists(${.CURDIR}/../../../Mk/bsd.port.mk) | |||||
PORTSDIR= ${.CURDIR}/../../.. | |||||
.else | |||||
PORTSDIR= /usr/ports | |||||
.endif | |||||
.endif | |||||
BSDPORTMK?= ${PORTSDIR}/Mk/bsd.port.mk | BSDPORTMK?= ${PORTSDIR}/Mk/bsd.port.mk | ||||
# Needed to keep bsd.own.mk from reading in /etc/src.conf | # Needed to keep bsd.own.mk from reading in /etc/src.conf | ||||
# and setting MK_* variables when building ports. | # and setting MK_* variables when building ports. | ||||
_WITHOUT_SRCCONF= | _WITHOUT_SRCCONF= | ||||
# Enable CTF conversion on request. | # Enable CTF conversion on request. | ||||
.if defined(WITH_CTF) | .if defined(WITH_CTF) | ||||
.undef NO_CTF | .undef NO_CTF | ||||
.endif | .endif | ||||
.include <bsd.own.mk> | .include <bsd.own.mk> | ||||
.include "${BSDPORTMK}" | .include "${BSDPORTMK}" |
At least use $${PWD} here.