summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Mk/bsd.port.mk42
1 files changed, 23 insertions, 19 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 7c8ee50a7bd4..b74c261a89a5 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -491,6 +491,10 @@ MASTERDIR?= ${.CURDIR}
# If they exist, include Makefile.inc, then architecture/operating
# system specific Makefiles, then local Makefile.local.
+.if ${MASTERDIR} != ${.CURDIR} && exists(${.CURDIR}/../Makefile.inc)
+.include "${.CURDIR}/../Makefile.inc"
+.endif
+
.if exists(${MASTERDIR}/../Makefile.inc)
.include "${MASTERDIR}/../Makefile.inc"
.endif
@@ -507,6 +511,25 @@ MASTERDIR?= ${.CURDIR}
.include "${MASTERDIR}/Makefile.local"
.endif
+.if defined(REQUIRE_PORTNAME) && !defined(PORTNAME)
+.BEGIN:
+ @${ECHO} "${PKGNAME}: You need to define PORTNAME and PORTVERSION instead of PKGNAME."
+ @${ECHO} "(This port is too old for your bsd.port.mk.)"
+ @${FALSE}
+.endif
+.if defined(PORTNAME)
+.if defined(PKGNAME) || !defined(PORTVERSION)
+.BEGIN:
+ @${ECHO} "${PKGNAME}: You need to define PORTNAME and PORTVERSION instead of PKGNAME."
+ @${FALSE}
+.endif
+PKGNAME= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PORTVERSION}
+DISTNAME?= ${PORTNAME}-${PORTVERSION}
+.else
+# old style
+PKGNAME?= ${DISTNAME}
+.endif
+
# These need to be absolute since we don't know how deep in the ports
# tree we are and thus can't go relative. They can, of course, be overridden
# by individual Makefiles or local system make configuration.
@@ -1104,25 +1127,6 @@ FETCH_BEFORE_ARGS+= -l
.endif
.endif
-.if defined(REQUIRE_PORTNAME) && !defined(PORTNAME)
-.BEGIN:
- @${ECHO} "${PKGNAME}: You need to define PORTNAME and PORTVERSION instead of PKGNAME."
- @${ECHO} "(This port is too old for your bsd.port.mk.)"
- @${FALSE}
-.endif
-.if defined(PORTNAME)
-.if defined(PKGNAME) || !defined(PORTVERSION)
-.BEGIN:
- @${ECHO} "${PKGNAME}: You need to define PORTNAME and PORTVERSION instead of PKGNAME."
- @${FALSE}
-.endif
-PKGNAME= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PORTVERSION}
-DISTNAME?= ${PORTNAME}-${PORTVERSION}
-.else
-# old style
-PKGNAME?= ${DISTNAME}
-.endif
-
DISTFILES?= ${DISTNAME}${EXTRACT_SUFX}
ALLFILES?= ${DISTFILES} ${PATCHFILES}