"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.
This commit is contained in:
cheusov 2012-05-27 14:32:28 +00:00
parent a84c99ca16
commit c8f63d3d1e
4 changed files with 63 additions and 4 deletions

View file

@ -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.
@ -92,6 +92,26 @@ ${_COOKIE.build}:
${_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)
######################################################################

View file

@ -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
@ -85,6 +85,15 @@ ${_COOKIE.test}:
${_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)
######################################################################
@ -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}

View file

@ -1,4 +1,4 @@
# $NetBSD: bsd.package.mk,v 1.14 2010/03/08 13:51:24 joerg Exp $
# $NetBSD: bsd.package.mk,v 1.15 2012/05/27 14:32:28 cheusov Exp $
#
# This Makefile fragment is included by bsd.pkg.mk and provides all
# variables and targets related to binary packages.
@ -39,6 +39,16 @@ repackage: package-eat-cookie package
package-clean: package-eat-cookie
${RUN} ${RM} -f ${PKGFILE}
######################################################################
### _package-clean (PRIVATE)
######################################################################
### _package-clean removes the state files for the "_package-clean" and
### later phases so that the "test" target may be re-invoked.
###
.PHONY: _package-clean
_package-clean: package-eat-cookie plist-clean check-files-clean
${RUN} ${RM} -rf ${DESTDIR}
######################################################################
### package-eat-cookie (PRIVATE)
######################################################################

View file

@ -1,4 +1,4 @@
# $NetBSD: plist.mk,v 1.42 2012/05/13 12:39:47 obache Exp $
# $NetBSD: plist.mk,v 1.43 2012/05/27 14:32:28 cheusov Exp $
#
# This Makefile fragment handles the creation of PLISTs for use by
# pkg_create(8).
@ -292,3 +292,13 @@ INFO_FILES_cmd= \
${PKGSRC_SETENV} ${_PLIST_AWK_ENV} ${AWK} ${_PLIST_INFO_AWK} | \
${AWK} '($$0 !~ "-[0-9]*(\\.gz)?$$") { print }'
.endif
######################################################################
### plist-clean (PRIVATE)
######################################################################
### plist-clean removes the files for the "plist"
### so that the "plist" target may be re-invoked.
###
.PHONY: plist-clean
plist-clean:
${RUN} ${RM} -f ${PLIST} ${_PLIST_NOKEYWORDS} ${_DEPENDS_PLIST}