summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorasami <asami@FreeBSD.org>1998-11-11 05:21:29 +0000
committerasami <asami@FreeBSD.org>1998-11-11 05:21:29 +0000
commit7aecd96aa5bcb77f2b7b0aed9b06cc31da23fbf2 (patch)
treeb1a609820d0f7976cfdd9de505e35bc70efeb028
parent1b99c0c5bec55dd3f8a00a97bd43aea26cbaea4e (diff)
downloadFreeBSD-src-7aecd96aa5bcb77f2b7b0aed9b06cc31da23fbf2.zip
FreeBSD-src-7aecd96aa5bcb77f2b7b0aed9b06cc31da23fbf2.tar.gz
Make bsd.port.mk includable in two phases. bsd.port.pre.mk defines only
a few variables that could be used in the port Makefile for ".if exists()" tests. bsd.port.post.mk defines the rest. Note: if you define USE_X_PREFIX or USE_IMAKE, put it before including bsd.port.pre.mk. These are the only two variables used in the first part. In reality, bsd.port.pre.mk and bsd.port.post.mk just include bsd.port.mk with special variables to turn part of it off.
-rw-r--r--share/mk/Makefile5
-rw-r--r--share/mk/bsd.port.mk80
-rw-r--r--share/mk/bsd.port.post.mk7
-rw-r--r--share/mk/bsd.port.pre.mk7
4 files changed, 69 insertions, 30 deletions
diff --git a/share/mk/Makefile b/share/mk/Makefile
index 0170c36..80d3311 100644
--- a/share/mk/Makefile
+++ b/share/mk/Makefile
@@ -1,10 +1,11 @@
-# $Id: Makefile,v 1.19 1998/08/29 11:01:22 wosch Exp $
+# $Id: Makefile,v 1.20 1998/09/09 10:17:34 bde Exp $
# @(#)Makefile 8.1 (Berkeley) 6/8/93
FILES= bsd.README
FILES+= bsd.dep.mk bsd.doc.mk bsd.docb.mk bsd.info.mk bsd.kern.mk bsd.kmod.mk
FILES+= bsd.lib.mk bsd.libnames.mk bsd.man.mk bsd.obj.mk bsd.own.mk
-FILES+= bsd.port.mk bsd.port.subdir.mk bsd.prog.mk bsd.sgml.mk bsd.subdir.mk
+FILES+= bsd.port.mk bsd.port.post.mk bsd.port.pre.mk bsd.port.subdir.mk
+FILES+= bsd.prog.mk bsd.sgml.mk bsd.subdir.mk
FILES+= sys.mk
NOOBJ= noobj
diff --git a/share/mk/bsd.port.mk b/share/mk/bsd.port.mk
index cf72823..eff539b 100644
--- a/share/mk/bsd.port.mk
+++ b/share/mk/bsd.port.mk
@@ -1,7 +1,7 @@
#-*- mode: Fundamental; tab-width: 4; -*-
# ex:ts=4
#
-# $Id: bsd.port.mk,v 1.294 1998/10/30 08:28:02 asami Exp $
+# $Id: bsd.port.mk,v 1.295 1998/11/08 10:29:52 asami Exp $
# $NetBSD: $
#
# bsd.port.mk - 940820 Jordan K. Hubbard.
@@ -36,6 +36,7 @@ OpenBSD_MAINTAINER= imp@OpenBSD.ORG
# makefile is being used on. Automatically set to
# "FreeBSD," "NetBSD," or "OpenBSD" as appropriate.
# OSREL - The release version (numeric) of the operating system.
+# OSVERSION - The value of __FreeBSD_version.
# PORTOBJFORMAT - The object format ("aout" or "elf").
#
# These variables are used to identify your port.
@@ -393,6 +394,9 @@ OpenBSD_MAINTAINER= imp@OpenBSD.ORG
# a different checksum and you intend to verify if
# the port still works with it.
+# Start of pre-makefile section.
+.if !defined(AFTERPORTMK)
+
# Get the architecture
ARCH!= uname -m
@@ -401,14 +405,12 @@ OPSYS!= uname -s
# Get the operating system revision
OSREL!= uname -r | sed -e 's/[-(].*//'
-PLIST_SUB+= OSREL=${OSREL}
+
+# Get __FreeBSD_version
+OSVERSION!= sysctl -n kern.osreldate
# Get the object format.
PORTOBJFORMAT!= test -x /usr/bin/objformat && /usr/bin/objformat || echo aout
-CONFIGURE_ENV+= PORTOBJFORMAT=${PORTOBJFORMAT}
-SCRIPTS_ENV+= PORTOBJFORMAT=${PORTOBJFORMAT}
-MAKE_ENV+= PORTOBJFORMAT=${PORTOBJFORMAT}
-PLIST_SUB+= PORTOBJFORMAT=${PORTOBJFORMAT}
# If they exist, include Makefile.inc, then architecture/operating
# system specific Makefiles, then local Makefile.local.
@@ -443,16 +445,6 @@ DISTDIR?= ${PORTSDIR}/distfiles
_DISTDIR?= ${DISTDIR}/${DIST_SUBDIR}
PACKAGES?= ${PORTSDIR}/packages
TEMPLATES?= ${PORTSDIR}/templates
-.if !defined(NO_WRKDIR)
-WRKDIR?= ${WRKDIRPREFIX}${.CURDIR}/work
-.else
-WRKDIR?= ${WRKDIRPREFIX}${.CURDIR}
-.endif
-.if defined(NO_WRKSUBDIR)
-WRKSRC?= ${WRKDIR}
-.else
-WRKSRC?= ${WRKDIR}/${DISTNAME}
-.endif
.if exists(${.CURDIR}/patches.${ARCH}-${OPSYS})
PATCHDIR?= ${.CURDIR}/patches.${ARCH}-${OPSYS}
@@ -494,6 +486,42 @@ PKGDIR?= ${.CURDIR}/pkg.${ARCH}
PKGDIR?= ${.CURDIR}/pkg
.endif
+.if defined(USE_IMAKE)
+USE_X_PREFIX= yes
+.endif
+.if defined(USE_X_PREFIX)
+USE_XLIB= yes
+.endif
+.if defined(USE_X_PREFIX)
+PREFIX?= ${X11BASE}
+.else
+PREFIX?= ${LOCALBASE}
+.endif
+
+.endif
+# End of pre-makefile section.
+
+# Start of post-makefile section.
+.if !defined(BEFOREPORTMK)
+
+.if !defined(NO_WRKDIR)
+WRKDIR?= ${WRKDIRPREFIX}${.CURDIR}/work
+.else
+WRKDIR?= ${WRKDIRPREFIX}${.CURDIR}
+.endif
+.if defined(NO_WRKSUBDIR)
+WRKSRC?= ${WRKDIR}
+.else
+WRKSRC?= ${WRKDIR}/${DISTNAME}
+.endif
+
+PLIST_SUB+= OSREL=${OSREL}
+
+CONFIGURE_ENV+= PORTOBJFORMAT=${PORTOBJFORMAT}
+SCRIPTS_ENV+= PORTOBJFORMAT=${PORTOBJFORMAT}
+MAKE_ENV+= PORTOBJFORMAT=${PORTOBJFORMAT}
+PLIST_SUB+= PORTOBJFORMAT=${PORTOBJFORMAT}
+
.if defined(MANCOMPRESSED)
.if ${MANCOMPRESSED} != yes && ${MANCOMPRESSED} != no && \
${MANCOMPRESSED} != maybe
@@ -509,18 +537,6 @@ MANCOMPRESSED?= yes
MANCOMPRESSED?= no
.endif
-.if defined(USE_IMAKE)
-USE_X_PREFIX= yes
-.endif
-.if defined(USE_X_PREFIX)
-USE_XLIB= yes
-.endif
-.if defined(USE_X_PREFIX)
-PREFIX?= ${X11BASE}
-.else
-PREFIX?= ${LOCALBASE}
-.endif
-
.if defined(USE_GMAKE)
BUILD_DEPENDS+= gmake:${PORTSDIR}/devel/gmake
.endif
@@ -1793,7 +1809,12 @@ pre-repackage:
.if !target(package-noinstall)
package-noinstall:
+.if !defined(NO_WRKDIR)
+ @${MKDIR} ${WRKDIR}
+.endif
@cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} PACKAGE_NOINSTALL=yes real-package
+ @${RM} ${TMPPLIST}
+ -@${RMDIR} ${WRKDIR}
.endif
# Loop through several options for package building
@@ -2189,3 +2210,6 @@ depend:
.if !target(tags)
tags:
.endif
+
+.endif
+# End of post-makefile section.
diff --git a/share/mk/bsd.port.post.mk b/share/mk/bsd.port.post.mk
new file mode 100644
index 0000000..be53028
--- /dev/null
+++ b/share/mk/bsd.port.post.mk
@@ -0,0 +1,7 @@
+# $Id$
+
+AFTERPORTMK= yes
+
+.include <bsd.port.mk>
+
+.undef AFTERPORTMK
diff --git a/share/mk/bsd.port.pre.mk b/share/mk/bsd.port.pre.mk
new file mode 100644
index 0000000..b4fc122
--- /dev/null
+++ b/share/mk/bsd.port.pre.mk
@@ -0,0 +1,7 @@
+# $Id$
+
+BEFOREPORTMK= yes
+
+.include <bsd.port.mk>
+
+.undef BEFOREPORTMK
OpenPOWER on IntegriCloud