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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
# $NetBSD: bsd.depends.mk,v 1.30 2019/05/07 19:36:44 rillig Exp $
#
# This Makefile fragment is included by bsd.pkg.mk and provides all
# variables and targets related to dependencies.
#
# The following are the "public" targets provided by this module:
#
# depends, bootstrap-depends, install-depends, show-depends
#
# The following variables may be set in a package Makefile:
#
# DEPENDS
# List of dependencies of the form "pattern:dir" needed by the
# package at run-time.
#
# BUILD_DEPENDS
# List of build dependencies of the form "pattern:dir" needed by the
# package at build-time. When cross-compiling, build dependencies
# are `target' packages, i.e. architecture for which the package is
# built.
#
# TEST_DEPENDS
# List of test dependencies of the form "pattern:dir" needed by the
# package at test-time. When cross-compiling, test dependencies
# are `native' packages, i.e. architecture where the package is
# built.
#
# TOOL_DEPENDS
# List of tool dependencies of the form "pattern:dir" needed by the
# package at build-time. When cross-compiling, tool dependencies
# are `native' packages, i.e. architecture where the package is
# built.
#
# The following variables may be set by the pkgsrc user:
#
# SKIP_DEPENDS
# Whether to run the ``depends'' phase. This is probably only
# useful for pkgsrc developers.
#
# Default value: no
#
# Keywords: depends dependencies
SKIP_DEPENDS?= no
# DEPENDS_TARGET is the target that is invoked to satisfy missing
# dependencies. This variable is user-settable in /etc/mk.conf.
#
.if !defined(DEPENDS_TARGET)
. if make(update)
. if defined(UPDATE_TARGET) && (${UPDATE_TARGET} == "replace")
DEPENDS_TARGET= ${UPDATE_TARGET}
. else
DEPENDS_TARGET= update
. endif
. elif make(bin-install) || make(su-bin-install)
DEPENDS_TARGET= bin-install
. elif make(package) || make(package-install)
DEPENDS_TARGET= package-install
. else
DEPENDS_TARGET= reinstall
. endif
.endif
######################################################################
### depends (PUBLIC)
######################################################################
### depends is a public target to install missing dependencies for
### the package.
###
.PHONY: depends
.if ${SKIP_DEPENDS:M[Nn][Oo]} != ""
. include "depends.mk"
.elif !target(depends)
. if exists(${_COOKIE.depends}) && !${_CLEANING}
depends:
@${DO_NADA}
. else
depends: depends-cookie
. endif
.endif
######################################################################
### bootstrap-depends (PUBLIC, OVERRIDE)
######################################################################
### bootstrap-depends is a public target to install any missing
### dependencies needed during stages before the normal "depends"
### stage. These dependencies are listed in BOOTSTRAP_DEPENDS.
###
.PHONY: bootstrap-depends
.if !target(bootstrap-depends)
bootstrap-depends:
@${DO_NADA}
.endif
######################################################################
### install-depends (PUBLIC)
######################################################################
### install-depends is a convenience target that installs all dependencies
### and removes the cookie file afterwards, so that the state of the
### filesystem remains unchanged.
###
### XXX This target is probably not needed and might be removed.
###
.PHONY: install-depends
install-depends: depends depends-clean
######################################################################
### depends-clean (PRIVATE)
######################################################################
### depends-clean removes the state files associated with the "depends"
### target so that "depends" may be re-invoked.
###
depends-clean:
${RUN}${RM} -f ${_COOKIE.depends}
${RUN} \
${RMDIR} -p ${_COOKIE.depends:H} 2>/dev/null || ${TRUE}
######################################################################
### depends-cookie (PRIVATE, override)
######################################################################
### depends-cookie creates the depends "cookie" state file. This should
### be overridden per package system format.
###
.PHONY: depends-cookie
depends-cookie:
${RUN}${TEST} ! -f ${_COOKIE.depends} || ${FALSE}
${RUN}${MKDIR} ${_COOKIE.depends:H}
${RUN}${TOUCH} ${TOUCH_ARGS} ${_COOKIE.depends}
# show-depends:
# Prints a list of dependencies.
#
# Command line variables:
#
# VARNAME
# DEPENDS, BUILD_DEPENDS, TEST_DEPENDS, or TOOL_DEPENDS.
#
# Keywords: depends dependencies
show-depends: .PHONY _pkgformat-show-depends
|