|
Added
Link Here
|
| 1 |
# $FreeBSD$ |
| 2 |
# |
| 3 |
# Provide support for verbose build output |
| 4 |
# |
| 5 |
# Feature: verbose |
| 6 |
# Usage: USES=verbose or USES=verbose:ARGS |
| 7 |
# Valid ARGS: env, var (default, implicit), list |
| 8 |
# ARGS description: |
| 9 |
# env Add verbose option to MAKE_ENV |
| 10 |
# var Add verbose option to defined VERBOSE_VAR variable(s) |
| 11 |
# list Add usage of VERBOSE_LIST variable |
| 12 |
# |
| 13 |
# Variables for ports: |
| 14 |
# VERBOSE_VAL - Verbose option, which added to specified variable(s) |
| 15 |
# Default: V=1 |
| 16 |
# VERBOSE_VAR - Custom defined variable(s), which used to add verbose |
| 17 |
# option. |
| 18 |
# Default: MAKE_ARGS |
| 19 |
# VERBOSE_LIST - Allows to specify additive (+=) and assign (=) operations |
| 20 |
# for specified variables, e.g. MAKE_ARGS+=V=1 |
| 21 |
# |
| 22 |
# MAINTAINER: portmgr@FreeBSD.org |
| 23 |
|
| 24 |
.if !defined(_INCLUDE_USES_VERBOSE_MK) |
| 25 |
_INCLUDE_USES_VERBOSE_MK= yes |
| 26 |
|
| 27 |
.if empty(verbose_ARGS) |
| 28 |
verbose_ARGS= var |
| 29 |
.endif |
| 30 |
|
| 31 |
_valid_ARGS= env var list |
| 32 |
|
| 33 |
# Sanity check |
| 34 |
.for arg in ${verbose_ARGS} |
| 35 |
. if empty(_valid_ARGS:M${arg}) |
| 36 |
IGNORE= Incorrect 'USES+= verbose:${verbose_ARGS}' usage: argument [${arg}] is\ |
| 37 |
not recognized |
| 38 |
. endif |
| 39 |
.endfor |
| 40 |
|
| 41 |
.ifndef LESS_VERBOSE |
| 42 |
|
| 43 |
VERBOSE_VAL?= V=1 |
| 44 |
VERBOSE_VAR?= MAKE_ARGS |
| 45 |
|
| 46 |
.if ${verbose_ARGS:Menv} |
| 47 |
MAKE_ENV+= ${VERBOSE_VAL} |
| 48 |
.endif |
| 49 |
|
| 50 |
.if ${verbose_ARGS:Mvar} |
| 51 |
. for var in ${VERBOSE_VAR} |
| 52 |
${var}+= ${VERBOSE_VAL} |
| 53 |
. endfor |
| 54 |
.endif |
| 55 |
|
| 56 |
.if ${verbose_ARGS:Mlist} |
| 57 |
.ifndef VERBOSE_LIST |
| 58 |
IGNORE= Incorrect 'USES+= verbose:list' usage: no VERBOSE_LIST variable defined |
| 59 |
.else |
| 60 |
.for var in ${VERBOSE_LIST:C/=.*//:O:u} |
| 61 |
_u= ${var} |
| 62 |
. if ${_u:M*+} |
| 63 |
${_u:C/.$//:tu}+= ${VERBOSE_LIST:M${var}=*:C/[^+]*\+=//:C/^"(.*)"$$/\1/} |
| 64 |
. else |
| 65 |
${_u:tu}= ${VERBOSE_LIST:M${var}=*:C/[^=]*=//:C/^"(.*)"$$/\1/} |
| 66 |
. endif |
| 67 |
.endfor |
| 68 |
.endif |
| 69 |
.endif |
| 70 |
|
| 71 |
.endif |
| 72 |
.endif |