From 032281d7e083f62b6a5219c4f066fe8013c3c5de Mon Sep 17 00:00:00 2001 From: jkh Date: Sun, 28 Aug 1994 14:41:34 +0000 Subject: [PATCH] Lots of changes - get the NO_XXX things over, add @'s to the touches for default extract and configure targets, add a pre-clean since I need it for pkg_install port. Submitted by: jkh --- share/mk/bsd.port.mk | 94 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 74 insertions(+), 20 deletions(-) diff --git a/share/mk/bsd.port.mk b/share/mk/bsd.port.mk index 0f2a0500eb9c..5f931a5c65d0 100644 --- a/share/mk/bsd.port.mk +++ b/share/mk/bsd.port.mk @@ -1,31 +1,47 @@ # bsd.port.mk - 940820 Jordan K. Hubbard. # This file is in the public domain. # -# $Id: bsd.port.mk,v 1.19 1994/08/25 21:02:45 jkh Exp $ +# $Id: bsd.port.mk,v 1.20 1994/08/25 22:59:56 jkh Exp $ # # Supported Variables and their behaviors: # -# GMAKE - Set to path of GNU make if not in $PATH. -# DISTDIR - Where to get gzip'd, tarballed copies of original sources. -# DISTNAME - Name of package or distribution. +# Variables that typically apply to all ports: +# +# PORTSDIR - The root of the ports tree (default: /usr/ports). +# DISTDIR - Where to get gzip'd, tarballed copies of original sources +# - (default: ${PORTSDIR}/distfiles. +# PACKAGES - A top level directory where all packages go (rather than +# - going someplace locally). (default: ${PORTSDIR}/packages). +# GMAKE - Set to path of GNU make if not in $PATH (default: gmake). +# XMKMF - Set to path of `xmkmf' if not in $PATH (default: xmkmf). +# +# Variables that typically apply to an individual port: +# # WRKDIR - A temporary working directory that gets *clobbered* on clean. # WRKSRC - A subdirectory of ${WRKDIR} where the distribution actually # unpacks to. Defaults to ${WRKDIR}/${DISTNAME}. +# DISTNAME - Name of port or distribution. # PATCHDIR - A directory containing required patches. # SCRIPTDIR - A directory containing auxilliary scripts. # FILESDIR - A directory containing any miscellaneous additional files. # PKGDIR - Package creation files. # -# USE_GMAKE - Says that the package uses gmake. -# USE_IMAKE - Says that the package uses imake. -# HAS_CONFIGURE - Says that the package has its own configure script. +# NO_EXTRACT - Use a dummy (do-nothing) extract target. +# NO_CONFIGURE - Use a dummy (do-nothing) configure target. +# NO_BUILD - Use a dummy (do-nothing) build target. +# NO_PACKAGE - Use a dummy (do-nothing) package target. +# NO_INSTALL - Use a dummy (do-nothing) install target. +# USE_GMAKE - Says that the port uses gmake. +# USE_IMAKE - Says that the port uses imake. +# HAS_CONFIGURE - Says that the port has its own configure script. # CONFIGURE_ARGS - Pass these args to configure, if $HAS_CONFIGURE. # HOME_LOCATION - site/path name (or user's email address) describing -# where this package came from or can be obtained if the +# where this port came from or can be obtained if the # tarball is missing. -# DEPENDS - A list of other packages this package depends on being -# made first. +# DEPENDS - A list of other ports this package depends on being +# made first, relative to ${PORTSDIR} (e.g. x11/tk, lang/tcl, +# etc). # # # Default targets and their behaviors: @@ -47,7 +63,7 @@ GMAKE?= gmake # These need to be absolute since we don't know how deep in the ports -# tree we are and thus can't go relative. It can, of course, be overridden +# tree we are and thus can't go relative. They can, of course, be overridden # by individual Makefiles. PORTSDIR?= /usr/ports DISTDIR?= ${PORTSDIR}/distfiles @@ -64,6 +80,10 @@ PKGDIR?= ${.CURDIR}/pkg EXTRACT_COOKIE?= ${.CURDIR}/.extract_done CONFIGURE_COOKIE?= ${.CURDIR}/.configure_done +# How to do nothing. Override if you, for some strange reason, would rather +# do something. +DO_NADA?= echo -n + # Miscellaneous overridable commands: EXTRACT_CMD?= tar EXTRACT_SUFX?= .tar.gz @@ -81,9 +101,38 @@ HOME_LOCATION?= .MAIN: all all: extract configure build +# The following are used to create easy dummy targets for disabling some +# bit of default target behavior you don't want. They still check to see +# if the target exists, and if so don't do anything, since you might want +# to set this globally for a group of ports in a Makefile.inc, but still +# be able to override from an individual Makefile (since you can't _undefine_ +# a variable in make!). +.if defined(NO_EXTRACT) && !target(extract) +extract: + @touch -f ${EXTRACT_COOKIE} +.endif +.if defined(NO_CONFIGURE) && !target(configure) +configure: + @touch -f ${CONFIGURE_COOKIE} +.endif +.if defined(NO_BUILD) && !target(build) +build: + @${DO_NADA} +.endif +.if defined(NO_PACKAGE) && !target(package) +package: + @${DO_NADA} +.endif +.if defined(NO_INSTALL) && !target(install) +install: + @${DO_NADA} +.endif + +# More standard targets start here. + .if !target(pre-install) pre-install: - @echo -n + @${DO_NADA} .endif .if !target(install) @@ -98,7 +147,7 @@ install: pre-install .if !target(pre-package) pre-package: - @echo -n + @${DO_NADA} .endif .if !target(package) @@ -119,7 +168,7 @@ package: pre-package .if !target(pre-build) pre-build: - @echo -n + @${DO_NADA} .endif .if !target(build) @@ -146,7 +195,7 @@ build: configure pre-build .if !target(pre-configure) pre-configure: - @echo -n + @${DO_NADA} .endif .if !target(configure) @@ -177,7 +226,7 @@ ${CONFIGURE_COOKIE}: @(cd ${WRKSRC}; ./configure ${CONFIGURE_ARGS}) .endif .if defined(USE_IMAKE) - @(cd ${WRKSRC}; xmkmf && make Makefiles) + @(cd ${WRKSRC}; ${XMKMF} && make Makefiles) .endif @if [ -f ${SCRIPTDIR}/post-configure ]; then \ sh ${SCRIPTDIR}/post-configure ${PORTSDIR} ${.CURDIR} ${WRKSRC}; \ @@ -187,7 +236,7 @@ ${CONFIGURE_COOKIE}: .if !target(pre-bundle) pre-bundle: - @echo -n + @${DO_NADA} .endif .if !target(bundle) @@ -208,7 +257,7 @@ bundle: pre-bundle .if !target(pre-extract) pre-extract: - @echo -n + @${DO_NADA} .endif .if !target(extract) @@ -233,15 +282,20 @@ ${EXTRACT_COOKIE}: @touch -f ${EXTRACT_COOKIE} .endif -# No pre-targets for clean, depend or tags. It would be silly. +.if !target(pre-clean) +pre-clean: + @${DO_NADA} +.endif .if !target(clean) -clean: +clean: pre-clean @echo "===> Cleaning for ${DISTNAME}" @rm -f ${EXTRACT_COOKIE} ${CONFIGURE_COOKIE} @rm -rf ${WRKDIR} .endif +# No pre-targets for depend or tags. It would be silly. + # Depend is generally meaningless for arbitrary ports, but if someone wants # one they can override this. This is just to catch people who've gotten into # the habit of typing `make depend all install' as a matter of course.