summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2006-06-05 17:41:11 +0000
committerjlam <jlam@pkgsrc.org>2006-06-05 17:41:11 +0000
commite3f0f1869fab80b87a12c5819925281415699ee2 (patch)
treecb985f3cb407fad54efc46217099126b1955727d
parentdeab97f9bd12ef89e434ec6d19998ca0b57021ae (diff)
downloadpkgsrc-e3f0f1869fab80b87a12c5819925281415699ee2.tar.gz
Allow overrides of the public targets, e.g. "install", "package", etc.
if PKG_SKIP_REASON or PKG_FAIL_REASON is defined. This commit adds !target(...) guards around those target definitions to avoid "duplicate target definition" warnings.
-rw-r--r--mk/depends/bsd.depends.mk4
-rw-r--r--mk/depends/depends.mk4
-rw-r--r--mk/install/bsd.install.mk4
-rw-r--r--mk/install/deinstall.mk6
-rw-r--r--mk/install/install.mk4
-rw-r--r--mk/install/replace.mk6
-rw-r--r--mk/package/bsd.package.mk10
-rw-r--r--mk/package/package.mk4
8 files changed, 32 insertions, 10 deletions
diff --git a/mk/depends/bsd.depends.mk b/mk/depends/bsd.depends.mk
index cb5c102bd35..b90290c2d79 100644
--- a/mk/depends/bsd.depends.mk
+++ b/mk/depends/bsd.depends.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.depends.mk,v 1.2 2006/06/05 17:21:55 jlam Exp $
+# $NetBSD: bsd.depends.mk,v 1.3 2006/06/05 17:41:11 jlam Exp $
#
# This Makefile fragment is included by bsd.pkg.mk and provides all
# variables and targets related to dependencies.
@@ -37,7 +37,9 @@ DEPENDS_TARGET= reinstall
###
.PHONY: depends
.if defined(NO_DEPENDS)
+. if !target(depends)
depends: depends-cookie
+. endif
.else
. include "${PKGSRCDIR}/mk/depends/depends.mk"
.endif
diff --git a/mk/depends/depends.mk b/mk/depends/depends.mk
index caa38a192bf..a43096193e4 100644
--- a/mk/depends/depends.mk
+++ b/mk/depends/depends.mk
@@ -1,4 +1,4 @@
-# $NetBSD: depends.mk,v 1.3 2006/06/05 14:11:39 jlam Exp $
+# $NetBSD: depends.mk,v 1.4 2006/06/05 17:41:11 jlam Exp $
######################################################################
### depends (PUBLIC)
@@ -11,7 +11,9 @@ _DEPENDS_TARGETS+= ${_DEPENDS_COOKIE}
_DEPENDS_TARGETS+= release-depends-lock
.PHONY: depends
+.if !target(depends)
depends: ${_DEPENDS_TARGETS}
+.endif
.PHONY: acquire-depends-lock release-depends-lock
acquire-depends-lock: acquire-lock
diff --git a/mk/install/bsd.install.mk b/mk/install/bsd.install.mk
index 2cfcb186e04..bd30a8e4f23 100644
--- a/mk/install/bsd.install.mk
+++ b/mk/install/bsd.install.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.install.mk,v 1.1 2006/06/03 23:11:42 jlam Exp $
+# $NetBSD: bsd.install.mk,v 1.2 2006/06/05 17:41:11 jlam Exp $
#
# This Makefile fragment is included by bsd.pkg.mk and provides all
# variables and targets related to installing packages.
@@ -21,7 +21,9 @@ _INSTALL_COOKIE= ${WRKDIR}/.install_done
###
.if defined(NO_INSTALL)
.PHONY: install
+. if !target(install)
install: ${_PKGSRC_BUILD_TARGETS} install-cookie
+. endif
.else
. include "${PKGSRCDIR}/mk/install/install.mk"
.endif
diff --git a/mk/install/deinstall.mk b/mk/install/deinstall.mk
index eccbd639911..3e23c64ea41 100644
--- a/mk/install/deinstall.mk
+++ b/mk/install/deinstall.mk
@@ -1,4 +1,4 @@
-# $NetBSD: deinstall.mk,v 1.1 2006/06/03 23:11:42 jlam Exp $
+# $NetBSD: deinstall.mk,v 1.2 2006/06/05 17:41:11 jlam Exp $
# DEINSTALLDEPENDS controls whether dependencies and dependents are also
# removed when a package is de-installed. The valid values are:
@@ -16,8 +16,10 @@ DEINSTALLDEPENDS?= no
### It will acquire elevated privileges just-in-time.
###
.PHONY: deinstall su-deinstall
+.if !target(deinstall)
deinstall: su-target
@${ECHO_MSG} "${_PKGSRC_IN}> Deinstalling for ${PKGNAME}"
+.endif
su-deinstall: deinstall-pkg install-clean
@@ -30,7 +32,9 @@ MAKEFLAGS.su-deinstall= DEINSTALLDEPENDS=${DEINSTALLDEPENDS}
### It will acquire elevated privileges just-in-time.
###
.PHONY: reinstall
+.if !target(reinstall)
reinstall: install-clean install
+.endif
######################################################################
### deinstall-pkg (PRIVATE, override)
diff --git a/mk/install/install.mk b/mk/install/install.mk
index 3ccfc610702..cbb609f5af9 100644
--- a/mk/install/install.mk
+++ b/mk/install/install.mk
@@ -1,4 +1,4 @@
-# $NetBSD: install.mk,v 1.1 2006/06/03 23:11:42 jlam Exp $
+# $NetBSD: install.mk,v 1.2 2006/06/05 17:41:11 jlam Exp $
######################################################################
### install (PUBLIC)
@@ -12,7 +12,9 @@ _INSTALL_TARGETS+= ${_INSTALL_COOKIE}
_INSTALL_TARGETS+= release-install-lock
.PHONY: install
+.if !target(install)
install: ${_INSTALL_TARGETS}
+.endif
.PHONY: acquire-install-lock release-install-lock
acquire-install-lock: acquire-lock
diff --git a/mk/install/replace.mk b/mk/install/replace.mk
index 76aaa977258..843a5c84842 100644
--- a/mk/install/replace.mk
+++ b/mk/install/replace.mk
@@ -1,4 +1,4 @@
-# $NetBSD: replace.mk,v 1.2 2006/06/05 17:21:55 jlam Exp $
+# $NetBSD: replace.mk,v 1.3 2006/06/05 17:41:11 jlam Exp $
######################################################################
### replace (PUBLIC)
@@ -11,7 +11,9 @@ _REPLACE_TARGETS+= replace-message
_REPLACE_TARGETS+= unprivileged-install-hook
.PHONY: replace su-replace
+.if !target(replace)
replace: ${_REPLACE_TARGETS} su-target
+.endif
replace-message:
@${ECHO_MSG} "${_PKGSRC_IN}> Replacing for ${PKGNAME}"
@@ -27,7 +29,9 @@ MAKEFLAGS.su-replace= _UPDATE_RUNNING=yes
### "replace" target. It will acquire elevated privileges just-in-time.
###
.PHONY: undo-replace su-undo-replace
+.if !target(undo-replace)
undo-replace: undo-replace-message su-target
+.endif
undo-replace-message:
@${ECHO_MSG} "${_PKGSRC_IN}> Undoing replacement for ${PKGNAME}"
diff --git a/mk/package/bsd.package.mk b/mk/package/bsd.package.mk
index d37a9433dc8..6d631010daf 100644
--- a/mk/package/bsd.package.mk
+++ b/mk/package/bsd.package.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.package.mk,v 1.1 2006/06/03 23:11:42 jlam Exp $
+# $NetBSD: bsd.package.mk,v 1.2 2006/06/05 17:41:11 jlam Exp $
#
# This Makefile fragment is included by bsd.pkg.mk and provides all
# variables and targets related to binary packages.
@@ -17,11 +17,13 @@ _PACKAGE_COOKIE= ${WRKDIR}/.package_done
###
.if defined(NO_PACKAGE)
.PHONY: package
+. if !target(package)
package: install
-. if defined(SKIP_SILENT)
+. if defined(SKIP_SILENT)
@${DO_NADA}
-. else
+. else
@${ECHO_MSG} "${_PKGSRC_IN}> ${PKGNAME} may not be packaged: "${NO_PACKAGE:Q}"."
+. endif
. endif
.else
. include "${PKGSRCDIR}/mk/package/package.mk"
@@ -33,7 +35,9 @@ package: install
### repackage is a special target to re-run the package target.
###
.PHONY: repackage
+.if !target(repackage)
repackage: package-clean package
+.endif
######################################################################
### package-clean (PRIVATE)
diff --git a/mk/package/package.mk b/mk/package/package.mk
index 58617b7eef8..b22a77eefe1 100644
--- a/mk/package/package.mk
+++ b/mk/package/package.mk
@@ -1,4 +1,4 @@
-# $NetBSD: package.mk,v 1.1 2006/06/03 23:11:42 jlam Exp $
+# $NetBSD: package.mk,v 1.2 2006/06/05 17:41:11 jlam Exp $
_PACKAGE_COOKIE= ${WRKDIR}/.package_done
@@ -14,7 +14,9 @@ _PACKAGE_TARGETS+= ${_PACKAGE_COOKIE}
_PACKAGE_TARGETS+= release-package-lock
.PHONY: package
+.if !target(package)
package: ${_PACKAGE_TARGETS}
+.endif
.PHONY: acquire-package-lock release-package-lock
acquire-package-lock: acquire-lock