summaryrefslogtreecommitdiff
path: root/mk/package/bsd.package.mk
blob: a7d2c4553d0eb49adbecf0ebc6d76ae1854df59e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# $NetBSD: bsd.package.mk,v 1.16 2012/10/02 22:45:47 cheusov Exp $
#
# This Makefile fragment is included by bsd.pkg.mk and provides all
# variables and targets related to binary packages.
#
# The following are the "public" targets provided by this module:
#
#    package, repackage, package-clean

_COOKIE.package=	${WRKDIR}/.package_done

######################################################################
### package (PUBLIC)
######################################################################
### package is a public target to generate a binary package.
###
.PHONY: package
.include "package.mk"

######################################################################
### repackage (PUBLIC)
######################################################################
### repackage is a special target to re-run the package target.
###
.PHONY: repackage
repackage: _package-clean
	${RUN} ${RECURSIVE_MAKE} ${MAKEFLAGS} package

######################################################################
### package-clean (PUBLIC)
######################################################################
### package-clean removes the binary package that has been created
### by the "package" phase.
### Also remove the cookie, so that the "package" target can be
### invoked again.
###
.PHONY: package-clean
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 "package" 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)
######################################################################
### package-eat-cookie removes the state files associated with the "package"
### phase so that the "package" target may be re-invoked.
###
package-eat-cookie:
	${RUN} ${RM} -f ${_COOKIE.package} ${_COOKIE.install}