| @@ -1,38 +1,40 @@ | | | @@ -1,38 +1,40 @@ |
1 | # $NetBSD: bsd.pkg.clean.mk,v 1.13 2007/11/15 12:09:52 rillig Exp $ | | 1 | # $NetBSD: bsd.pkg.clean.mk,v 1.14 2013/06/01 19:31:52 rillig Exp $ |
2 | # | | 2 | # |
3 | # This Makefile fragment is included to bsd.pkg.mk and defines the | | 3 | # This Makefile fragment is included to bsd.pkg.mk and defines the |
4 | # relevant variables and targets for the "clean" phase. | | 4 | # relevant variables and targets for the "clean" phase. |
5 | # | | 5 | # |
6 | # The following variables may be set by the package Makefile and | | 6 | # The following variables may be set by the package Makefile and |
7 | # specify how cleaning happens: | | 7 | # specify how cleaning happens: |
8 | # | | 8 | # |
9 | # CLEANDEPENDS specifies the whether "cleaning" will also clean | | 9 | # CLEANDEPENDS specifies the whether "cleaning" will also clean |
10 | # in all dependencies, implied and direct. CLEANDEPENDS | | 10 | # in all dependencies, implied and direct. CLEANDEPENDS |
11 | # defaults to "no". | | 11 | # defaults to "no". |
12 | # | | 12 | # |
13 | # The following targets are defined by bsd.pkg.clean.mk: | | 13 | # The following targets are defined by bsd.pkg.clean.mk: |
14 | # | | 14 | # |
15 | # clean-depends is the target which descends into dependencies' | | 15 | # clean-depends: |
16 | # package directories and invokes the "clean" action. | | 16 | # descends into dependencies' package directories and invokes the |
| | | 17 | # "clean" action. |
| | | 18 | # |
| | | 19 | # do-clean: |
| | | 20 | # does the actual cleaning, which involves removing the work |
| | | 21 | # directory and other temporary files used by the package. |
17 | # | | 22 | # |
18 | # do-clean is the target that does the actual cleaning, which | | 23 | # clean: |
19 | # involves removing the work directory and other temporary | | 24 | # is invoked by the user to perform the "clean" action. |
20 | # files used by the package. | | | |
21 | # | | 25 | # |
22 | # clean is the target that is invoked by the user to perform | | 26 | # cleandir: |
23 | # the "clean" action. | | 27 | # an alias for "clean". |
24 | # | | | |
25 | # cleandir is an alias for "clean". | | | |
26 | # | | 28 | # |
27 | | | 29 | |
28 | CLEANDEPENDS?= no | | 30 | CLEANDEPENDS?= no |
29 | | | 31 | |
30 | .if defined(PRIVILEGED_STAGES) && !empty(PRIVILEGED_STAGES:Mclean) | | 32 | .if defined(PRIVILEGED_STAGES) && !empty(PRIVILEGED_STAGES:Mclean) |
31 | _MAKE_CLEAN_AS_ROOT=yes | | 33 | _MAKE_CLEAN_AS_ROOT=yes |
32 | .endif | | 34 | .endif |
33 | | | 35 | |
34 | .PHONY: clean-depends | | 36 | .PHONY: clean-depends |
35 | clean-depends: | | 37 | clean-depends: |
36 | ${RUN} \ | | 38 | ${RUN} \ |
37 | ${_DEPENDS_WALK_CMD} ${PKGPATH} | \ | | 39 | ${_DEPENDS_WALK_CMD} ${PKGPATH} | \ |
38 | while read dir; do \ | | 40 | while read dir; do \ |