diff options
author | rillig <rillig> | 2007-01-02 21:29:07 +0000 |
---|---|---|
committer | rillig <rillig> | 2007-01-02 21:29:07 +0000 |
commit | 66ee105d8e970a3df6c13e26aa53dd87eafb86e9 (patch) | |
tree | d570516cf0c477f61fa2608a856c32c27a0adc76 | |
parent | 7fe68fff900a63221d40f54e95595592a20291d2 (diff) | |
download | pkgsrc-66ee105d8e970a3df6c13e26aa53dd87eafb86e9.tar.gz |
Moved the show-tools target to misc/show.mk.
Moved the changes-entry target to misc/developer.mk. To save some time,
that file is only included when PKG_DEVELOPER is defined.
Moved the build-defs-message target to misc/show.mk and renamed it to
show-build-defs, since almost all other *-message targets just print a
single line.
-rw-r--r-- | mk/bsd.pkg.mk | 66 | ||||
-rw-r--r-- | mk/internal/build-defs-message.mk | 52 | ||||
-rw-r--r-- | mk/misc/developer.mk | 44 | ||||
-rw-r--r-- | mk/misc/show.mk | 67 |
4 files changed, 117 insertions, 112 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index 1a91fe17c89..af537f6eb4a 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.mk,v 1.1901 2007/01/02 21:04:52 rillig Exp $ +# $NetBSD: bsd.pkg.mk,v 1.1902 2007/01/02 21:29:07 rillig Exp $ # # This file is in the public domain. # @@ -852,68 +852,14 @@ ${_MAKEVARS_MK.${_phase_}}: ${WRKDIR} ${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_FLAGS} ${.TARGET} .endfor -# show-tools emits a /bin/sh shell script that defines all known tools -# to the values they have in the pkgsrc infrastructure. -# -# Don't move this code away from here unless you know what you're doing. -# -.PHONY: show-tools -show-tools: -.for _t_ in ${_USE_TOOLS} -. if defined(_TOOLS_VARNAME.${_t_}) - @${ECHO} ${_TOOLS_VARNAME.${_t_}:Q}=${${_TOOLS_VARNAME.${_t_}}:Q:Q} -. endif -.endfor - -# changes-entry appends a correctly-formatted entry to the pkgsrc -# CHANGES file. -# -# The following variables may be set: -# -# CTYPE is the type of entry to add and is one of "Added", "Updated", -# "Renamed", "Moved", of "Removed". The default CTYPE is "Updated". -# -# NETBSD_LOGIN_NAME is the login name assigned by the NetBSD Project. -# It defaults to the local login name. -# -# PKGSRC_CHANGES is the path to the CHANGES file to which the entry -# is appended. It defaults to ${PKGSRCDIR}/doc/CHANGES-YYYY. -# -# Example usage: -# -# % cd /usr/pkgsrc/category/package -# % make changes-entry CTYPE=Added -# -CTYPE?= Updated -NETBSD_LOGIN_NAME?= ${_NETBSD_LOGIN_NAME_cmd:sh} -PKGSRC_CHANGES?= ${PKGSRCDIR}/doc/CHANGES-${_CYEAR_cmd:sh} - -_CYEAR_cmd= ${DATE} -u +%Y -_CDATE_cmd= ${DATE} -u +%Y-%m-%d -_NETBSD_LOGIN_NAME_cmd= ${ID} -nu - -_CTYPE1= " "${CTYPE:Q}" "${PKGPATH:Q} -.if !empty(CTYPE:MUpdated) -_CTYPE2= " to "${PKGVERSION:Q} -.elif !empty(CTYPE:MAdded) -_CTYPE2= " version "${PKGVERSION:Q} -.elif !empty(CTYPE:MRenamed) || !empty(CTYPE:MMoved) -_CTYPE2= " to XXX" -.else -_CTYPE2= +.if defined(PKG_DEVELOPER) +. include "${.PARSEDIR}/misc/developer.mk" .endif -_CTYPE3= " ["${NETBSD_LOGIN_NAME:Q}" "${_CDATE_cmd:sh:Q}"]" - -.PHONY: changes-entry -changes-entry: - ${_PKG_SILENT}${_PKG_DEBUG} \ - ${ECHO} ${_CTYPE1}${_CTYPE2}${_CTYPE3} >> ${PKGSRC_CHANGES:Q} - -.include "${PKGSRCDIR}/mk/internal/build-defs-message.mk" +.include "${.PARSEDIR}/misc/show.mk" .if make(debug) || make(build-env) -.include "${PKGSRCDIR}/mk/bsd.pkg.debug.mk" +. include "${PKGSRCDIR}/mk/bsd.pkg.debug.mk" .endif .if make(help) -.include "${PKGSRCDIR}/mk/help/help.mk" +. include "${PKGSRCDIR}/mk/help/help.mk" .endif .include "${.PARSEDIR}/misc/can-be-built-here.mk" diff --git a/mk/internal/build-defs-message.mk b/mk/internal/build-defs-message.mk deleted file mode 100644 index 9ddc1c875a6..00000000000 --- a/mk/internal/build-defs-message.mk +++ /dev/null @@ -1,52 +0,0 @@ -# $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. -# - -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 -.endif - -.PHONY: build-defs-message -build-defs-message: -build-defs-message: ${WRKDIR} -.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}) - @${ECHO} " * ${var} (not defined)" -. elif defined(${var}) && empty(${var}) - @${ECHO} " * ${var} (defined)" -. else - @${ECHO} " * ${var} = ${${var}}" -. 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 diff --git a/mk/misc/developer.mk b/mk/misc/developer.mk new file mode 100644 index 00000000000..1ee5f7eb47f --- /dev/null +++ b/mk/misc/developer.mk @@ -0,0 +1,44 @@ +# changes-entry appends a correctly-formatted entry to the pkgsrc +# CHANGES file. +# +# The following variables may be set: +# +# CTYPE is the type of entry to add and is one of "Added", "Updated", +# "Renamed", "Moved", of "Removed". The default CTYPE is "Updated". +# +# NETBSD_LOGIN_NAME is the login name assigned by the NetBSD Project. +# It defaults to the local login name. +# +# PKGSRC_CHANGES is the path to the CHANGES file to which the entry +# is appended. It defaults to ${PKGSRCDIR}/doc/CHANGES-YYYY. +# +# Example usage: +# +# % cd /usr/pkgsrc/category/package +# % make changes-entry CTYPE=Added +# +CTYPE?= Updated +NETBSD_LOGIN_NAME?= ${_NETBSD_LOGIN_NAME_cmd:sh} +PKGSRC_CHANGES?= ${PKGSRCDIR}/doc/CHANGES-${_CYEAR_cmd:sh} + +_CYEAR_cmd= ${DATE} -u +%Y +_CDATE_cmd= ${DATE} -u +%Y-%m-%d +_NETBSD_LOGIN_NAME_cmd= ${ID} -nu + +_CTYPE1= " "${CTYPE:Q}" "${PKGPATH:Q} +.if !empty(CTYPE:MUpdated) +_CTYPE2= " to "${PKGVERSION:Q} +.elif !empty(CTYPE:MAdded) +_CTYPE2= " version "${PKGVERSION:Q} +.elif !empty(CTYPE:MRenamed) || !empty(CTYPE:MMoved) +_CTYPE2= " to XXX" +.else +_CTYPE2= +.endif +_CTYPE3= " ["${NETBSD_LOGIN_NAME:Q}" "${_CDATE_cmd:sh:Q}"]" + +.PHONY: changes-entry +changes-entry: + ${_PKG_SILENT}${_PKG_DEBUG} \ + ${ECHO} ${_CTYPE1}${_CTYPE2}${_CTYPE3} >> ${PKGSRC_CHANGES:Q} + diff --git a/mk/misc/show.mk b/mk/misc/show.mk new file mode 100644 index 00000000000..cbe21c0ea07 --- /dev/null +++ b/mk/misc/show.mk @@ -0,0 +1,67 @@ +# $NetBSD: show.mk,v 1.1 2007/01/02 21:29:07 rillig Exp $ +# +# This file contains some targets that print information gathered from +# variables. They do not modify any variables. +# + +# show-tools: +# Emits a /bin/sh shell script that defines all known tools +# to the values they have in the pkgsrc infrastructure. +# +show-tools: .PHONY +.for t in ${_USE_TOOLS} +. if defined(_TOOLS_VARNAME.${t}) + @${ECHO} ${_TOOLS_VARNAME.${t}:Q}=${${_TOOLS_VARNAME.${t}}:Q:Q} +. endif +.endfor + +# show-build-defs: +# Prints the variables that can be configured by the pkgsrc user +# in mk.conf, and the effects that those settings have. +# + +BUILD_DEFS?= # none +BUILD_DEFS_EFFECTS?= # none + +.if !empty(PKGSRC_SHOW_BUILD_DEFS:M[yY][eE][sS]) +pre-depends-hook: show-build-defs +.endif + +show-build-defs: .PHONY +.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}) + @${ECHO} " * ${var} (not defined)" +. elif defined(${var}) && empty(${var}) + @${ECHO} " * ${var} (defined)" +. else + @${ECHO} " * ${var} = "${${var}:Q} +. endif +. endfor +. if !empty(BUILD_DEFS_EFFECTS:M*) + @${ECHO} "" + @${ECHO} "Based on these variables, the following variables have been set:" + @${ECHO} "" +. endif +. for var in ${BUILD_DEFS_EFFECTS:O} +. if !defined(${var}) + @${ECHO} " * ${var} (not defined)" +. elif defined(${var}) && empty(${var}) + @${ECHO} " * ${var} (defined, but empty)" +. else + @${ECHO} " * ${var} = "${${var}: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} "==========================================================================" +.endif + +# @deprecated -- remove after 2007Q1 +build-defs-message: show-build-defs .PHONY |