mk/*: improve documentation for "make help"diff -r1.12 -r1.13 pkgsrc/mk/alternatives.mk
(rillig)
@@ -1,40 +1,48 @@ | @@ -1,40 +1,48 @@ | |||
1 | # $NetBSD: alternatives.mk,v 1.12 2015/11/25 13:05:47 jperkin Exp $ | 1 | # $NetBSD: alternatives.mk,v 1.13 2018/05/16 21:23:02 rillig Exp $ | |
2 | # | 2 | # | |
3 | # This Makefile fragment handles the alternatives system, registering a | 3 | # This Makefile fragment handles the alternatives system, registering a | |
4 | # package in the database. | 4 | # package in the database. | |
5 | # | 5 | # | |
6 | # User-settable variables: | 6 | # User-settable variables: | |
7 | # | 7 | # | |
8 | # (none) | 8 | # (none) | |
9 | # | 9 | # | |
10 | # Package-settable variables: | 10 | # Package-settable variables: | |
11 | # | 11 | # | |
12 | # ALTERNATIVES_SRC | 12 | # ALTERNATIVES_SRC | |
13 | # A _single_ file that contains the alternatives provided by the | 13 | # A _single_ file that contains the alternatives provided by the | |
14 | # package. | 14 | # package. | |
15 | # | 15 | # | |
16 | # Default value: The name of the ALTERNATIVES file in the package | 16 | # Default value: The name of the ALTERNATIVES file in the package | |
17 | # directory, if it exists. Otherwise, nothing. | 17 | # directory, if it exists. Otherwise, nothing. | |
18 | # | 18 | # | |
19 | # Each line of the alternatives file contains two filenames, first | 19 | # Each line of the alternatives file contains two filenames: | |
20 | # the wrapper and then the alternative provided by the package. | 20 | # | |
21 | # wrapper alternative | |||
22 | # | |||
23 | # The wrapper is the command that is run by the user. | |||
24 | # The alternative is the implementation of that command that is | |||
25 | # provided by the package. | |||
21 | # Both paths are relative to PREFIX. | 26 | # Both paths are relative to PREFIX. | |
27 | # The paths may use placeholders of the form @VARNAME@, which are | |||
28 | # replaced with the actual values as per FILES_SUBST. | |||
22 | # | 29 | # | |
23 | # Variables defined by this file: | 30 | # Variables defined by this file: | |
24 | # | 31 | # | |
25 | # PKG_ALTERNATIVES | 32 | # PKG_ALTERNATIVES | |
26 | # The path to the pkg_alternatives command. | 33 | # The path to the pkg_alternatives command. | |
27 | # | 34 | # | |
35 | # Keywords: alternatives | |||
28 | 36 | |||
29 | .if !defined(ALTERNATIVES_MK) | 37 | .if !defined(ALTERNATIVES_MK) | |
30 | ALTERNATIVES_MK= # defined | 38 | ALTERNATIVES_MK= # defined | |
31 | 39 | |||
32 | _VARGROUPS+= alternatives | 40 | _VARGROUPS+= alternatives | |
33 | _PKG_VARS.alternatives= ALTERNATIVES_SRC | 41 | _PKG_VARS.alternatives= ALTERNATIVES_SRC | |
34 | _SYS_VARS.alternatives= PKG_ALTERNATIVES | 42 | _SYS_VARS.alternatives= PKG_ALTERNATIVES | |
35 | 43 | |||
36 | .if exists(${.CURDIR}/ALTERNATIVES) | 44 | .if exists(${.CURDIR}/ALTERNATIVES) | |
37 | ALTERNATIVES_SRC?= ${.CURDIR}/ALTERNATIVES | 45 | ALTERNATIVES_SRC?= ${.CURDIR}/ALTERNATIVES | |
38 | .endif | 46 | .endif | |
39 | ALTERNATIVES_SRC?= # none | 47 | ALTERNATIVES_SRC?= # none | |
40 | 48 |
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: build.mk,v 1.22 2017/06/01 02:15:10 jlam Exp $ | 1 | # $NetBSD: build.mk,v 1.23 2018/05/16 21:23:02 rillig Exp $ | |
2 | # | 2 | # | |
3 | # This file defines what happens in the build phase, excluding the | 3 | # This file defines what happens in the build phase, excluding the | |
4 | # self-test, which is defined in test.mk. | 4 | # self-test, which is defined in test.mk. | |
5 | # | 5 | # | |
6 | # Public targets for developers: | 6 | # Public targets for developers: | |
7 | # | 7 | # | |
8 | # build-env: | 8 | # build-env: | |
9 | # Runs an interactive shell (BUILD_ENV_SHELL) in the environment | 9 | # Runs an interactive shell (BUILD_ENV_SHELL) in the environment | |
10 | # that is used for building the package. | 10 | # that is used for building the package. | |
11 | # | 11 | # | |
12 | # Package-settable variables: | 12 | # Package-settable variables: | |
13 | # | 13 | # | |
14 | # BUILD_MAKE_FLAGS is the list of arguments that is passed to the make | 14 | # BUILD_MAKE_FLAGS is the list of arguments that is passed to the make | |
@@ -170,22 +170,37 @@ do-build: | @@ -170,22 +170,37 @@ do-build: | |||
170 | . endfor | 170 | . endfor | |
171 | .endif | 171 | .endif | |
172 | 172 | |||
173 | .if !target(pre-build) | 173 | .if !target(pre-build) | |
174 | pre-build: | 174 | pre-build: | |
175 | @${DO_NADA} | 175 | @${DO_NADA} | |
176 | .endif | 176 | .endif | |
177 | 177 | |||
178 | .if !target(post-build) | 178 | .if !target(post-build) | |
179 | post-build: | 179 | post-build: | |
180 | @${DO_NADA} | 180 | @${DO_NADA} | |
181 | .endif | 181 | .endif | |
182 | 182 | |||
183 | # build-env: | |||
184 | # Starts an interactive shell in WRKSRC. | |||
185 | # | |||
186 | # This is only used during development and testing of a package | |||
187 | # to work in the same environment as the actual build. | |||
188 | # | |||
189 | # User-settable variables: | |||
190 | # | |||
191 | # BUILD_ENV_SHELL | |||
192 | # The shell to start. | |||
193 | # | |||
194 | # Default: ${SH} | |||
195 | # | |||
196 | # Keywords: debug build | |||
197 | ||||
183 | BUILD_ENV_SHELL?= ${SH} | 198 | BUILD_ENV_SHELL?= ${SH} | |
184 | .if defined(_PKGSRC_BARRIER) | 199 | .if defined(_PKGSRC_BARRIER) | |
185 | build-env: .PHONY configure | 200 | build-env: .PHONY configure | |
186 | @${STEP_MSG} "Entering the build environment for ${PKGNAME}" | 201 | @${STEP_MSG} "Entering the build environment for ${PKGNAME}" | |
187 | ${RUN}${_ULIMIT_CMD} \ | 202 | ${RUN}${_ULIMIT_CMD} \ | |
188 | cd ${WRKSRC} && ${PKGSRC_SETENV} ${MAKE_ENV} ${BUILD_ENV_SHELL} | 203 | cd ${WRKSRC} && ${PKGSRC_SETENV} ${MAKE_ENV} ${BUILD_ENV_SHELL} | |
189 | .else | 204 | .else | |
190 | build-env: barrier | 205 | build-env: barrier | |
191 | .endif | 206 | .endif |
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: bin-install.mk,v 1.26 2017/08/19 00:30:19 jlam Exp $ | 1 | # $NetBSD: bin-install.mk,v 1.27 2018/05/16 21:23:02 rillig Exp $ | |
2 | # | 2 | # | |
3 | 3 | |||
4 | # This file provides the following targets: | 4 | # This file provides the following targets: | |
5 | # | 5 | # | |
6 | # bin-install: | 6 | # bin-install: | |
7 | # Tries to install a package from a prebuilt binary package, and | 7 | # Tries to install a package from a prebuilt binary package, and | |
8 | # if that doesn't work, builds the package from source. | 8 | # if that doesn't work, builds the package from source. | |
9 | # | 9 | # | |
10 | # === User-settable variables === | 10 | # === User-settable variables === | |
11 | # | 11 | # | |
12 | # PACKAGES | 12 | # PACKAGES | |
13 | # This directory is searched before BINPKG_SITES when trying to | 13 | # This directory is searched before BINPKG_SITES when trying to | |
14 | # install binary packages. | 14 | # install binary packages. | |
@@ -17,28 +17,29 @@ | @@ -17,28 +17,29 @@ | |||
17 | # A list of URLs where binary packages can be found. | 17 | # A list of URLs where binary packages can be found. | |
18 | # See mk/defaults/mk.conf for details. | 18 | # See mk/defaults/mk.conf for details. | |
19 | # | 19 | # | |
20 | # === Command line variables === | 20 | # === Command line variables === | |
21 | # | 21 | # | |
22 | # PKGNAME_REQD | 22 | # PKGNAME_REQD | |
23 | # The package pattern that is required to be installed. By default, | 23 | # The package pattern that is required to be installed. By default, | |
24 | # any version of this package will do, but when installing | 24 | # any version of this package will do, but when installing | |
25 | # dependencies, a special version may be needed. | 25 | # dependencies, a special version may be needed. | |
26 | 26 | |||
27 | # XXX: This file contains implementation details from the "pkg" format, | 27 | # XXX: This file contains implementation details from the "pkg" format, | |
28 | # for example the All/ directory and the @cwd. | 28 | # for example the All/ directory and the @cwd. | |
29 | 29 | |||
30 | # List of sites carrying binary pkgs. Variables "rel" and "arch" are | 30 | # List of sites carrying binary packages. Shell Variables "rel" and | |
31 | # replaced with OS release ("1.5", ...) and architecture ("mipsel", ...) | 31 | # "arch" are replaced with OS release ("1.5", ...) and architecture | |
32 | # ("mipsel", ...). | |||
32 | .if ${OPSYS} == "NetBSD" | 33 | .if ${OPSYS} == "NetBSD" | |
33 | BINPKG_SITES?= \ | 34 | BINPKG_SITES?= \ | |
34 | http://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/$${arch}/$${rel} \ | 35 | http://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/$${arch}/$${rel} \ | |
35 | http://ftp6.NetBSD.org/pub/pkgsrc/packages/NetBSD/$${arch}/$${rel} | 36 | http://ftp6.NetBSD.org/pub/pkgsrc/packages/NetBSD/$${arch}/$${rel} | |
36 | .elif ${OPSYS} == "Minix" | 37 | .elif ${OPSYS} == "Minix" | |
37 | BINPKG_SITES?= \ | 38 | BINPKG_SITES?= \ | |
38 | ftp://ftp.minix3.org/pub/minix/packages/$$(${UNAME} -r)/$${arch} | 39 | ftp://ftp.minix3.org/pub/minix/packages/$$(${UNAME} -r)/$${arch} | |
39 | .elif ${OPSYS} == "DragonFly" | 40 | .elif ${OPSYS} == "DragonFly" | |
40 | BINPKG_SITES?= \ | 41 | BINPKG_SITES?= \ | |
41 | http://mirror-master.dragonflybsd.org/packages/$${arch}/DragonFly-$${rel}/stable | 42 | http://mirror-master.dragonflybsd.org/packages/$${arch}/DragonFly-$${rel}/stable | |
42 | .else | 43 | .else | |
43 | BINPKG_SITES?= | 44 | BINPKG_SITES?= | |
44 | .endif | 45 | .endif |
@@ -1,35 +1,36 @@ | @@ -1,35 +1,36 @@ | |||
1 | # $NetBSD: can-be-built-here.mk,v 1.8 2015/01/01 06:06:06 dholland Exp $ | 1 | # $NetBSD: can-be-built-here.mk,v 1.9 2018/05/16 21:23:02 rillig Exp $ | |
2 | # | 2 | # | |
3 | # This file checks whether a package can be built in the current pkgsrc | 3 | # This file checks whether a package can be built in the current pkgsrc | |
4 | # environment. It checks the following variables: | 4 | # environment. It checks the following variables: | |
5 | # | 5 | # | |
6 | # * NOT_FOR_COMPILER, ONLY_FOR_COMPILER | 6 | # * NOT_FOR_COMPILER, ONLY_FOR_COMPILER | |
7 | # * NOT_FOR_PLATFORM, ONLY_FOR_PLATFORM | 7 | # * NOT_FOR_PLATFORM, ONLY_FOR_PLATFORM | |
8 | # * BROKEN_ON_PLATFORM, BROKEN_EXCEPT_ON_PLATFORM | 8 | # * BROKEN_ON_PLATFORM, BROKEN_EXCEPT_ON_PLATFORM | |
9 | # * NOT_FOR_BULK_PLATFORM | 9 | # * NOT_FOR_BULK_PLATFORM | |
10 | # * NOT_FOR_UNPRIVILEGED, ONLY_FOR_UNPRIVILEGED | 10 | # * NOT_FOR_UNPRIVILEGED, ONLY_FOR_UNPRIVILEGED | |
11 | # * PKG_FAIL_REASON, PKG_SKIP_REASON | 11 | # * PKG_FAIL_REASON, PKG_SKIP_REASON | |
12 | # | 12 | # | |
13 | # It also depends on the following internal variables: | 13 | # It also depends on the following internal variables: | |
14 | # | 14 | # | |
15 | # NO_SKIP | 15 | # NO_SKIP | |
16 | # When defined, the checks in this file are skipped. It is called | 16 | # When defined, the checks in this file are skipped. It is called | |
17 | # NO_SKIP because the code that skips building the package should | 17 | # NO_SKIP because the code that skips building the package should | |
18 | # _not_ be run. | 18 | # _not_ be run. | |
19 | # | 19 | # | |
20 | # XXX: It's weird to have three negations in such a short variable | 20 | # XXX: It's weird to have three negations in such a short variable | |
21 | # name. | 21 | # name. | |
22 | # | 22 | # | |
23 | # Keywords: compiler broken only platform | |||
23 | 24 | |||
24 | _CBBH_CHECKS= # none, but see below. | 25 | _CBBH_CHECKS= # none, but see below. | |
25 | 26 | |||
26 | # Check NOT_FOR_COMPILER | 27 | # Check NOT_FOR_COMPILER | |
27 | _CBBH_CHECKS+= ncomp | 28 | _CBBH_CHECKS+= ncomp | |
28 | _CBBH_MSGS.ncomp= "This package is not available for these compilers: "${NOT_FOR_COMPILER:Q}"." | 29 | _CBBH_MSGS.ncomp= "This package is not available for these compilers: "${NOT_FOR_COMPILER:Q}"." | |
29 | 30 | |||
30 | _CBBH.ncomp= yes | 31 | _CBBH.ncomp= yes | |
31 | .for c in ${NOT_FOR_COMPILER} | 32 | .for c in ${NOT_FOR_COMPILER} | |
32 | . for pc in ${PKGSRC_COMPILER} | 33 | . for pc in ${PKGSRC_COMPILER} | |
33 | # The left-hand side of the == operator must be a "real" variable. | 34 | # The left-hand side of the == operator must be a "real" variable. | |
34 | _c:= ${c} | 35 | _c:= ${c} | |
35 | . if ${_c} == ${pc} | 36 | . if ${_c} == ${pc} |