summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mk/bsd.makevars.mk6
-rw-r--r--mk/bsd.pkg.barrier.mk5
-rw-r--r--mk/help/destdir.help4
-rw-r--r--mk/install/bsd.install.mk30
-rw-r--r--mk/install/install.mk18
-rw-r--r--mk/package/package.mk4
6 files changed, 42 insertions, 25 deletions
diff --git a/mk/bsd.makevars.mk b/mk/bsd.makevars.mk
index fbbebcc6177..14a7c167d89 100644
--- a/mk/bsd.makevars.mk
+++ b/mk/bsd.makevars.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.makevars.mk,v 1.4 2006/07/10 22:59:27 jlam Exp $
+# $NetBSD: bsd.makevars.mk,v 1.5 2010/02/24 22:53:34 joerg Exp $
#
# This Makefile fragment is included by bsd.prefs.mk to set all of
# the variables saved through MAKEVARS. Typical usage is:
@@ -20,8 +20,8 @@
#
_ALL_PHASES= fetch tools extract patch \
- wrapper configure build install package
-_REV_ALL_PHASES= package install build configure wrapper \
+ wrapper configure build stage-install package
+_REV_ALL_PHASES= package stage-install build configure wrapper \
patch extract tools fetch
# Try including the *.makevars.mk files in reverse order so that the
diff --git a/mk/bsd.pkg.barrier.mk b/mk/bsd.pkg.barrier.mk
index dcc41b69115..d60b8377e26 100644
--- a/mk/bsd.pkg.barrier.mk
+++ b/mk/bsd.pkg.barrier.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.barrier.mk,v 1.17 2009/05/16 01:27:30 joerg Exp $
+# $NetBSD: bsd.pkg.barrier.mk,v 1.18 2010/02/24 22:53:34 joerg Exp $
_COOKIE.barrier= ${WRKDIR}/.barrier_cookie
@@ -22,12 +22,13 @@ _BARRIER_POST_TARGETS+= configure
_BARRIER_POST_TARGETS+= build build-env
_BARRIER_POST_TARGETS+= test
_BARRIER_POST_TARGETS+= all
-_BARRIER_POST_TARGETS+= install
+_BARRIER_POST_TARGETS+= stage-install
_BARRIER_POST_TARGETS+= reinstall
_BARRIER_POST_TARGETS+= replace
_BARRIER_POST_TARGETS+= package
_BARRIER_POST_TARGETS+= repackage
_BARRIER_POST_TARGETS+= package-install
+_BARRIER_POST_TARGETS+= install
.for _target_ in ${_BARRIER_POST_TARGETS}
. if make(${_target_})
diff --git a/mk/help/destdir.help b/mk/help/destdir.help
index d7e77c794ec..b0b8b25f38b 100644
--- a/mk/help/destdir.help
+++ b/mk/help/destdir.help
@@ -1,4 +1,4 @@
-# $NetBSD: destdir.help,v 1.4 2009/05/09 14:59:08 joerg Exp $
+# $NetBSD: destdir.help,v 1.5 2010/02/24 22:53:34 joerg Exp $
#
# ===
# Warning: This file is still under construction. Don't rely on it.
@@ -40,7 +40,7 @@
#
# === Implementation notes ===
#
-# In the "install" phase, the variable DESTDIR is set in the make(1)
+# In the "stage-install" phase, the variable DESTDIR is set in the make(1)
# environment of the default "do-install" target. Additionally, the
# variable is passed in the INSTALL_MAKE_FLAGS to override potential
# "DESTDIR=" entries in the Makefiles.
diff --git a/mk/install/bsd.install.mk b/mk/install/bsd.install.mk
index 7c92902d76d..2486c5da14e 100644
--- a/mk/install/bsd.install.mk
+++ b/mk/install/bsd.install.mk
@@ -1,11 +1,11 @@
-# $NetBSD: bsd.install.mk,v 1.12 2008/01/04 01:46:27 rillig Exp $
+# $NetBSD: bsd.install.mk,v 1.13 2010/02/24 22:53:34 joerg Exp $
#
# This Makefile fragment is included by bsd.pkg.mk and provides all
# variables and targets related to installing packages.
#
# The following are the "public" targets provided this module:
#
-# install, deinstall, reinstall, replace, undo-replace
+# install, stage-install, deinstall, reinstall, replace, undo-replace
#
# The following targets may be overridden in a package Makefile:
#
@@ -17,19 +17,35 @@ _COOKIE.install= ${WRKDIR}/.install_done
######################################################################
### install (PUBLIC)
######################################################################
-### install is a public target to install the package.
+### install is a public target to install the package either by
+### depending on stage-install (_USE_DESTDIR=no) or package-install
+### (_USE_DESTDIR!=no).
###
.PHONY: install
+.if ${_USE_DESTDIR} == "no"
+install: stage-install
+.else
+install: package-install
+.endif
+
+######################################################################
+### stage-install (PUBLIC)
+######################################################################
+### stage-install is a public target to install the package to
+### ${PREFIX} (_USE_DESTDIR=no) or to ${DESTDIR}${PREFIX}
+### (_USE_DESTDIR!=no)
+###
+.PHONY: stage-install
.if !defined(NO_INSTALL)
. include "install.mk"
-.elif !target(install)
+.else
. if exists(${_COOKIE.install})
-install:
+stage-install:
@${DO_NADA}
. elif defined(_PKGSRC_BARRIER)
-install: ${_PKGSRC_BUILD_TARGETS} install-cookie
+stage-install: ${_PKGSRC_BUILD_TARGETS} install-cookie
. else
-install: barrier
+stage-install: barrier
. endif
.endif
diff --git a/mk/install/install.mk b/mk/install/install.mk
index 146fdab105e..978ee07df66 100644
--- a/mk/install/install.mk
+++ b/mk/install/install.mk
@@ -1,11 +1,11 @@
-# $NetBSD: install.mk,v 1.57 2009/10/06 13:34:53 joerg Exp $
+# $NetBSD: install.mk,v 1.58 2010/02/24 22:53:34 joerg Exp $
#
# This file provides the code for the "install" phase.
#
# Public targets:
#
-# install:
-# Installs the package files into LOCALBASE.
+# stage-install:
+# Installs the package files into LOCALBASE or ${DESTDIR}${LOCALBASE}.
#
# Interface for other infrastructure components:
@@ -62,15 +62,15 @@ _INSTALL_TARGETS+= acquire-install-lock
_INSTALL_TARGETS+= ${_COOKIE.install}
_INSTALL_TARGETS+= release-install-lock
-.PHONY: install
-.if !target(install)
+.PHONY: stage-install
+.if !target(stage-install)
. if exists(${_COOKIE.install})
-install:
+stage-install:
@${DO_NADA}
. elif defined(_PKGSRC_BARRIER)
-install: ${_INSTALL_TARGETS}
+stage-install: ${_INSTALL_TARGETS}
. else
-install: barrier
+stage-install: barrier
. endif
.endif
@@ -94,7 +94,7 @@ ${_COOKIE.install}: real-install
_REAL_INSTALL_TARGETS+= install-check-interactive
_REAL_INSTALL_TARGETS+= install-check-version
_REAL_INSTALL_TARGETS+= install-message
-_REAL_INSTALL_TARGETS+= install-vars
+_REAL_INSTALL_TARGETS+= stage-install-vars
_REAL_INSTALL_TARGETS+= unprivileged-install-hook
_REAL_INSTALL_TARGETS+= install-all
_REAL_INSTALL_TARGETS+= install-cookie
diff --git a/mk/package/package.mk b/mk/package/package.mk
index c068db5357f..72e5de64082 100644
--- a/mk/package/package.mk
+++ b/mk/package/package.mk
@@ -1,4 +1,4 @@
-# $NetBSD: package.mk,v 1.21 2009/06/09 08:40:28 joerg Exp $
+# $NetBSD: package.mk,v 1.22 2010/02/24 22:53:34 joerg Exp $
#
# This file provides the code for the "package" phase.
#
@@ -16,7 +16,7 @@ _PACKAGE_TARGETS+= check-vulnerable
.if make(replace) && ${_USE_DESTDIR} == "no"
_PACKAGE_TARGETS+= replace
.else
-_PACKAGE_TARGETS+= install
+_PACKAGE_TARGETS+= stage-install
.endif
_PACKAGE_TARGETS+= acquire-package-lock
_PACKAGE_TARGETS+= ${_COOKIE.package}