diff options
author | rillig <rillig@pkgsrc.org> | 2006-11-04 21:54:26 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2006-11-04 21:54:26 +0000 |
commit | 74efb02f37463df6b45c1b359c3c6e933d04ec6a (patch) | |
tree | d93ea10334209c73f9c671ae6536f99adac0af0d /mk/internal | |
parent | 7913bf045a8422bc4ebb77078733147f41d6d674 (diff) | |
download | pkgsrc-74efb02f37463df6b45c1b359c3c6e933d04ec6a.tar.gz |
There is a difference between the variables that can be configured by
the user to affect how packages are built (BUILD_DEFS) and the effects
that those variables have (BUILD_DEFS_EFFECTS). The latter variable has
been introduced to clearly separate these two issues.
While here, reduced the indentation of the directives a little bit. One
visible change is that "make build-defs-message" will always show the
message when called directly. Before, it had been shown only once, which
makes debugging a bit more difficult.
Diffstat (limited to 'mk/internal')
-rw-r--r-- | mk/internal/build-defs-message.mk | 43 |
1 files changed, 29 insertions, 14 deletions
diff --git a/mk/internal/build-defs-message.mk b/mk/internal/build-defs-message.mk index 7cd032c6121..9ddc1c875a6 100644 --- a/mk/internal/build-defs-message.mk +++ b/mk/internal/build-defs-message.mk @@ -1,37 +1,52 @@ -# $NetBSD: build-defs-message.mk,v 1.1 2006/07/15 23:58:52 rillig Exp $ +# $NetBSD: build-defs-message.mk,v 1.2 2006/11/04 21:54:26 rillig Exp $ # # The build-defs-message target shows the variables that can be configured # by the pkgsrc user in mk.conf. # -.PHONY: build-defs-message +BUILD_DEFS?= # none +BUILD_DEFS_EFFECTS?= # none + +.if !empty(PKGSRC_SHOW_BUILD_DEFS:M[yY][eE][sS]) && !exists(${WRKDIR}/.bdm_done) pre-depends-hook: build-defs-message -.if empty(PKGSRC_SHOW_BUILD_DEFS:M[yY][eE][sS]) +.endif + +.PHONY: build-defs-message build-defs-message: -.elif !target(build-defs-message) build-defs-message: ${WRKDIR} -. if defined(BUILD_DEFS) && !empty(BUILD_DEFS) -. if !exists(${WRKDIR}/.bdm_done) +.if !empty(BUILD_DEFS:M*) @${ECHO} "==========================================================================" @${ECHO} "The following variables will affect the build process of this package," @${ECHO} "${PKGNAME}. Their current value is shown below:" @${ECHO} "" -. for var in ${BUILD_DEFS:O} -. if !defined(${var}) +. for var in ${BUILD_DEFS:O} +. if !defined(${var}) @${ECHO} " * ${var} (not defined)" -. elif defined(${var}) && empty(${var}) +. elif defined(${var}) && empty(${var}) @${ECHO} " * ${var} (defined)" -. else +. else @${ECHO} " * ${var} = ${${var}}" -. endif -. endfor +. endif +. endfor +. if !empty(BUILD_DEFS_EFFECTS:M*) + @${ECHO} "" + @${ECHO} "Based on these variables, the following variables have been set:" + @${ECHO} "" +. endif +. for v in ${BUILD_DEFS_EFFECTS} +. if !defined(${v}) + @${ECHO} " * ${v} (not defined)" +. elif defined(${v}) && empty(${v}) + @${ECHO} " * ${v} (defined, but empty)" +. else + @${ECHO} " * ${v} = "${${v}:Q}"" +. endif +. endfor @${ECHO} "" @${ECHO} "You may want to abort the process now with CTRL-C and change their value" @${ECHO} "before continuing. Be sure to run \`${MAKE} clean' after" @${ECHO} "the changes." @${ECHO} "==========================================================================" @${TOUCH} ${WRKDIR}/.bdm_done -. endif -. endif .endif |