Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Jan 2000 20:55:51 -0800 (PST)
From:      asami@cs.berkeley.edu (Satoshi Asami)
To:        ports@freebsd.org
Subject:   multiple includes of bsd.port.*mk
Message-ID:  <200001070455.UAA52328@silvia.hip.berkeley.edu>

next in thread | raw e-mail | index | archive | help
Hi,

It seems people are starting to be a little lax about not including
bsd.port.mk twice.  This usually happens when you include
bsd.port.pre.mk and then include ${MASTERDIR}/Makefile, which will
include it (or bsd.port.mk).  As I said last week, you're not supposed
to do this, and although it works now, it could cause problems in the
future.

How about this patch to flag those mistakes?

Satoshi
-------
Index: bsd.port.mk
===================================================================
RCS file: /usr/cvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.324
diff -u -r1.324 bsd.port.mk
--- bsd.port.mk	1999/11/11 02:36:15	1.324
+++ bsd.port.mk	2000/01/07 02:59:52
@@ -435,6 +435,14 @@
 # Start of pre-makefile section.
 .if !defined(AFTERPORTMK)
 
+.if defined(PREMKINCLUDED)
+.BEGIN:
+	@${ECHO} "${PKGNAME}: You cannot include bsd.port[.pre].mk twice"
+	@${FALSE}
+.endif
+
+PREMKINCLUDED=	yes
+
 # Get the architecture
 .if !defined(ARCH)
 ARCH!=	/usr/bin/uname -m
@@ -568,6 +576,14 @@
 # Start of post-makefile section.
 .if !defined(BEFOREPORTMK)
 
+.if defined(POSTMKINCLUDED)
+.BEGIN:
+	@${ECHO} "${PKGNAME}: You cannot include bsd.port[.post].mk twice"
+	@${FALSE}
+.endif
+
+POSTMKINCLUDED=	yes
+
 WRKDIR?=		${WRKDIRPREFIX}${.CURDIR}/work
 .if defined(NO_WRKSUBDIR)
 WRKSRC?=		${WRKDIR}


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200001070455.UAA52328>