summaryrefslogtreecommitdiff
path: root/mk/build
diff options
context:
space:
mode:
authorcheusov <cheusov>2012-05-27 14:32:28 +0000
committercheusov <cheusov>2012-05-27 14:32:28 +0000
commit9a98298712f45f3f3eba001756280184418dc34a (patch)
tree2d5ac1dcc597b56b5a2acf31f3dea1459d4c88bb /mk/build
parent80681d2742a1f0f2f7dcd42db185cc95b5a709ba (diff)
downloadpkgsrc-9a98298712f45f3f3eba001756280184418dc34a.tar.gz
"rebuild" and "retest" targets were added (by analogy with "reinstall").
rebuild is a special target to re-run the build target. retest is a special target to re-run the test target.
Diffstat (limited to 'mk/build')
-rw-r--r--mk/build/build.mk22
-rw-r--r--mk/build/test.mk21
2 files changed, 41 insertions, 2 deletions
diff --git a/mk/build/build.mk b/mk/build/build.mk
index ce530f8a904..5366b97c3bc 100644
--- a/mk/build/build.mk
+++ b/mk/build/build.mk
@@ -1,4 +1,4 @@
-# $NetBSD: build.mk,v 1.20 2011/09/08 20:17:15 abs Exp $
+# $NetBSD: build.mk,v 1.21 2012/05/27 14:32:29 cheusov Exp $
#
# This file defines what happens in the build phase, excluding the
# self-test, which is defined in test.mk.
@@ -93,6 +93,26 @@ ${_COOKIE.build}: real-build
.endif
######################################################################
+### rebuild (PUBLIC)
+######################################################################
+### rebuild is a special target to re-run the build target.
+###
+
+.PHONY: rebuild
+rebuild: build-clean
+ ${RUN} ${RECURSIVE_MAKE} ${MAKEFLAGS} build
+
+######################################################################
+### build-clean (PRIVATE)
+######################################################################
+### build-clean removes the state files for the "build" and
+### later phases so that the "build" target may be re-invoked.
+###
+.PHONY: build-clean
+build-clean: install-clean _package-clean
+ ${RUN} ${RM} -f ${_COOKIE.build}
+
+######################################################################
### real-build (PRIVATE)
######################################################################
### real-build is a helper target onto which one can hook all of the
diff --git a/mk/build/test.mk b/mk/build/test.mk
index 4855c75bbc3..5263b61b185 100644
--- a/mk/build/test.mk
+++ b/mk/build/test.mk
@@ -1,4 +1,4 @@
-# $NetBSD: test.mk,v 1.17 2012/05/02 13:44:27 obache Exp $
+# $NetBSD: test.mk,v 1.18 2012/05/27 14:32:29 cheusov Exp $
#
# After the "build" phase, many packages provide some sort of self-test
# that can be run on the not-yet installed package. To enable these
@@ -86,6 +86,15 @@ ${_COOKIE.test}: real-test
.endif
######################################################################
+### retest (PUBLIC)
+######################################################################
+### retest is a special target to re-run the test target.
+###
+.PHONY: retest
+retest: test-clean
+ ${RUN} ${RECURSIVE_MAKE} ${MAKEFLAGS} test
+
+######################################################################
### real-test (PRIVATE)
######################################################################
### real-test is a helper target onto which one can hook all of the
@@ -164,3 +173,13 @@ test-cookie:
${RUN}${TEST} ! -f ${_COOKIE.test} || ${FALSE}
${RUN}${MKDIR} ${_COOKIE.test:H}
${RUN}${ECHO} ${PKGNAME} > ${_COOKIE.test}
+
+######################################################################
+### test-clean (PRIVATE)
+######################################################################
+### test-clean removes the state files for the "test" and
+### later phases so that the "test" target may be re-invoked.
+###
+.PHONY: test-clean
+test-clean:
+ ${RUN} ${RM} -f ${_COOKIE.test}