2021-02-11 01:51:11 +00:00
|
|
|
# $NetBSD: varname-make_print_var_on_error.mk,v 1.6 2021/02/04 21:33:14 rillig Exp $
|
2020-09-05 16:11:04 +00:00
|
|
|
#
|
2020-11-07 19:39:21 +00:00
|
|
|
# Tests for the special MAKE_PRINT_VAR_ON_ERROR variable, which prints the
|
|
|
|
# values of selected variables on error.
|
2020-09-05 16:11:04 +00:00
|
|
|
|
2020-11-07 19:39:21 +00:00
|
|
|
# XXX: As of 2020-10-23, the .ERROR_CMD variable is pointless in compat mode
|
|
|
|
# since at the point where it is filled in PrintOnError, the first command in
|
|
|
|
# gn->commands has been set to NULL already. This leaves .ERROR_CMD an empty
|
|
|
|
# list.
|
2021-01-14 01:24:34 +00:00
|
|
|
#
|
|
|
|
# See also:
|
|
|
|
# compat-error.mk
|
|
|
|
|
2021-02-11 01:51:11 +00:00
|
|
|
# XXX: As of 2021-02-04, PrintOnError calls Var_Subst with SCOPE_GLOBAL, which
|
2021-01-14 01:24:34 +00:00
|
|
|
# does not expand the node-local variables like .TARGET. This results in the
|
|
|
|
# double '${.TARGET}' in the output.
|
2020-11-07 19:39:21 +00:00
|
|
|
|
|
|
|
MAKE_PRINT_VAR_ON_ERROR= .ERROR_TARGET .ERROR_CMD
|
2020-09-05 16:11:04 +00:00
|
|
|
|
|
|
|
all:
|
2021-01-14 01:24:34 +00:00
|
|
|
@: before '${.TARGET}' '$${.TARGET}' '$$$${.TARGET}'
|
|
|
|
echo fail ${.TARGET}; false '${.TARGET}' '$${.TARGET}' '$$$${.TARGET}'
|
|
|
|
@: after '${.TARGET}' '$${.TARGET}' '$$$${.TARGET}'
|