summaryrefslogtreecommitdiff
path: root/mk/bsd.pkg.mk
diff options
context:
space:
mode:
authorjlam <jlam>2006-03-15 16:20:11 +0000
committerjlam <jlam>2006-03-15 16:20:11 +0000
commit3ab4361a92bf498b05f332df8076f317c40cf977 (patch)
tree83c4e5001e87182f4b48e1036082836a09fd6b0a /mk/bsd.pkg.mk
parente4f7c0c75d096019c7513f8a58c5a540c9cdba61 (diff)
downloadpkgsrc-3ab4361a92bf498b05f332df8076f317c40cf977.tar.gz
Always run the pkginstall framework targets to generate the
INSTALL/DEINSTALL and rc.d scripts, regardless of whether NO_BUILD is defined or not. We do this by renaming the main "build" target to "_build", and creating a new "build" target that has "_build" and "pkginstall" as dependencies. This allows the "build" and "install" targets to be consecutive, so no changes in behavior are visible to the user. Because the pkginstall targets are no longer run within the protection of the locks during the build phase, we need to manage locking within a new "pkginstall" target.
Diffstat (limited to 'mk/bsd.pkg.mk')
-rw-r--r--mk/bsd.pkg.mk36
1 files changed, 19 insertions, 17 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index 47d43b76afe..e83ceb24249 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.1809 2006/03/15 14:06:09 jlam Exp $
+# $NetBSD: bsd.pkg.mk,v 1.1810 2006/03/15 16:20:11 jlam Exp $
#
# This file is in the public domain.
#
@@ -410,6 +410,16 @@ INSTALL_MACROS= BSD_INSTALL_PROGRAM=${INSTALL_PROGRAM:Q} \
MAKE_ENV+= ${INSTALL_MACROS}
SCRIPTS_ENV+= ${INSTALL_MACROS}
+# If pkgsrc is supposed to ensure that tests are run before installation
+# of the package, then the build targets should be "build test", otherwise
+# just "build" suffices.
+#
+.if !empty(PKGSRC_RUN_TEST:M[yY][eE][sS])
+_PKGSRC_BUILD_TARGETS= build test
+.else
+_PKGSRC_BUILD_TARGETS= build
+.endif
+
# The user can override the NO_PACKAGE by specifying this from
# the make command line
.if defined(FORCE_PACKAGE)
@@ -463,17 +473,6 @@ MESSAGE_SUBST+= PKGNAME=${PKGNAME} \
MESSAGE_SUBST_SED= ${MESSAGE_SUBST:S/=/}!/:S/$/!g/:S/^/ -e s!\\\${/}
.endif
-# If pkgsrc is supposed to ensure that tests are run before installation
-# of the package, then the build targets should be "build test", otherwise
-# just "build" suffices. _PKGSRC_BUILD_TARGETS is used in the "all",
-# "install", and "uptodate-digest" targets.
-#
-.if !empty(PKGSRC_RUN_TEST:M[yY][eE][sS])
-_PKGSRC_BUILD_TARGETS= build test
-.else
-_PKGSRC_BUILD_TARGETS= build
-.endif
-
.PHONY: uptodate-digest
uptodate-digest:
.if !empty(USE_DIGEST:M[yY][eE][sS])
@@ -983,8 +982,8 @@ configure: wrapper
# Disable build
.PHONY: build
-.if defined(NO_BUILD) && !target(build)
-build: configure
+.if defined(NO_BUILD)
+_build: configure
${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_FLAGS} ${_BUILD_COOKIE}
.endif
@@ -2105,11 +2104,14 @@ wrapper: tools acquire-wrapper-lock ${_WRAPPER_COOKIE} release-wrapper-lock
configure: wrapper acquire-configure-lock ${_CONFIGURE_COOKIE} release-configure-lock
.endif
-.PHONY: build
-.if !target(build)
-build: configure acquire-build-lock ${_BUILD_COOKIE} release-build-lock
+.PHONY: _build
+.if !target(_build)
+_build: configure acquire-build-lock ${_BUILD_COOKIE} release-build-lock
.endif
+.PHONY: build
+build: pkginstall
+
.PHONY: test
.if !target(test)
test: build ${_TEST_COOKIE}