diff options
author | asami <asami@FreeBSD.org> | 1998-11-11 13:21:29 +0800 |
---|---|---|
committer | asami <asami@FreeBSD.org> | 1998-11-11 13:21:29 +0800 |
commit | 7aed28166a84f266be861367fc9a1add43f9219a (patch) | |
tree | 02d4875e76d3162cc59279a8845c5855e8517140 /Mk | |
parent | 39a845ba15a75a1699e0078308c5c36df68903a5 (diff) | |
download | freebsd-ports-gnome-7aed28166a84f266be861367fc9a1add43f9219a.tar.gz freebsd-ports-gnome-7aed28166a84f266be861367fc9a1add43f9219a.tar.zst freebsd-ports-gnome-7aed28166a84f266be861367fc9a1add43f9219a.zip |
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.
Diffstat (limited to 'Mk')
-rw-r--r-- | Mk/bsd.port.mk | 80 | ||||
-rw-r--r-- | Mk/bsd.port.post.mk | 7 | ||||
-rw-r--r-- | Mk/bsd.port.pre.mk | 7 |
3 files changed, 66 insertions, 28 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk index cf7282328b01..eff539b41ed7 100644 --- a/Mk/bsd.port.mk +++ b/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/Mk/bsd.port.post.mk b/Mk/bsd.port.post.mk new file mode 100644 index 000000000000..be53028b5607 --- /dev/null +++ b/Mk/bsd.port.post.mk @@ -0,0 +1,7 @@ +# $Id$ + +AFTERPORTMK= yes + +.include <bsd.port.mk> + +.undef AFTERPORTMK diff --git a/Mk/bsd.port.pre.mk b/Mk/bsd.port.pre.mk new file mode 100644 index 000000000000..b4fc122add09 --- /dev/null +++ b/Mk/bsd.port.pre.mk @@ -0,0 +1,7 @@ +# $Id$ + +BEFOREPORTMK= yes + +.include <bsd.port.mk> + +.undef BEFOREPORTMK |