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.
This commit is contained in:
Satoshi Asami 1998-11-11 05:21:29 +00:00
parent b18735cb01
commit 218515c5f8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=41073
4 changed files with 69 additions and 30 deletions

View File

@ -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

View File

@ -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.

View File

@ -0,0 +1,7 @@
# $Id$
AFTERPORTMK= yes
.include <bsd.port.mk>
.undef AFTERPORTMK

7
share/mk/bsd.port.pre.mk Normal file
View File

@ -0,0 +1,7 @@
# $Id$
BEFOREPORTMK= yes
.include <bsd.port.mk>
.undef BEFOREPORTMK