aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1994-10-03 22:38:27 +0800
committerjkh <jkh@FreeBSD.org>1994-10-03 22:38:27 +0800
commit44a991d03592514ee348f37569a6f223956b1fd0 (patch)
treecd6c859109f31d2dbbadba661b0bf554b0fb792b /Mk
parentbc9bd8471259a8b1ff6f27c3d9b8c3f88bc3f726 (diff)
downloadfreebsd-ports-gnome-44a991d03592514ee348f37569a6f223956b1fd0.tar.gz
freebsd-ports-gnome-44a991d03592514ee348f37569a6f223956b1fd0.tar.zst
freebsd-ports-gnome-44a991d03592514ee348f37569a6f223956b1fd0.zip
Prevent duplicate installs with an install cookie.
Make DEPENDS now does a `make is_depended' in the target port. This defaults to `all install' globally, but can be overriden locally by a port if it wants to do different things when other ports depend on it.
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.port.mk16
1 files changed, 12 insertions, 4 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 0a8c599d7913..29aa0eaafadc 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -3,7 +3,7 @@
# bsd.port.mk - 940820 Jordan K. Hubbard.
# This file is in the public domain.
#
-# $Id: bsd.port.mk,v 1.41 1994/09/28 14:19:30 jkh Exp $
+# $Id: bsd.port.mk,v 1.42 1994/10/03 13:45:03 jkh Exp $
#
# Please view me with 4 column tabs!
@@ -101,6 +101,7 @@ PKGDIR?= ${.CURDIR}/pkg
# Change these if you'd prefer to keep the cookies someplace else.
EXTRACT_COOKIE?= ${WRKDIR}/.extract_done
CONFIGURE_COOKIE?= ${WRKDIR}/.configure_done
+INSTALL_COOKIE?= ${WRKDIR}/.install_done
# How to do nothing. Override if you, for some strange reason, would rather
# do something.
@@ -143,6 +144,10 @@ PKGFILE?= ${DISTNAME}${PKG_SUFX}
.MAIN: all
all: extract configure build
+.if !target(is_depended)
+is_depended: all install
+.endif
+
# 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
@@ -167,7 +172,7 @@ package:
.endif
.if defined(NO_INSTALL) && !target(install)
install:
- @${DO_NADA}
+ @touch -f ${INSTALL_COOKIE}
.endif
# More standard targets start here.
@@ -178,13 +183,16 @@ pre-install:
.endif
.if !target(install)
-install: pre-install
+install: ${INSTALL_COOKIE}
+
+${INSTALL_COOKIE}: pre-install
@echo "===> Installing for ${DISTNAME}"
.if defined(USE_GMAKE)
@(cd ${WRKSRC}; ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} install)
.else defined(USE_GMAKE)
@(cd ${WRKSRC}; ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} install)
.endif
+ @touch -f ${INSTALL_COOKIE}
.endif
.if !target(pre-package)
@@ -218,7 +226,7 @@ build: configure pre-build
if [ ! -d ${PORTSDIR}/$$i ]; then \
echo ">> No directory for ${PORTSDIR}/$$i. Skipping.."; \
else \
- (cd ${PORTSDIR}/$$i; ${MAKE} all install) ; \
+ (cd ${PORTSDIR}/$$i; ${MAKE} is_depended) ; \
fi \
done
@echo "===> Returning to build of ${DISTNAME}"