xref: /freebsd/contrib/bmake/unit-tests/varname-make_print_var_on_error-jobs.mk (revision 36d6566e5985030fd2f1100bd9c1387bbe0bd290)
1# $NetBSD: varname-make_print_var_on_error-jobs.mk,v 1.1 2020/10/23 06:18:23 rillig Exp $
2#
3# Tests for the special MAKE_PRINT_VAR_ON_ERROR variable, which prints the
4# values of selected variables on error.
5#
6# The variable .ERROR_CMD contains all commands of the target, with variable
7# expressions expanded, just as they were printed to the shell command file.
8#
9# The commands in .ERROR_CMD are space-separated.  Since each command usually
10# contains spaces as well, this value is only intended as a first hint to what
11# happened.  For more details, use the debug options -de, -dj, -dl, -dn, -dx.
12
13# As of 2020-10-23, .ERROR_CMD only works in parallel mode.
14.MAKEFLAGS: -j1
15
16MAKE_PRINT_VAR_ON_ERROR=	.ERROR_TARGET .ERROR_CMD
17
18all:
19	@: command before
20	@echo fail; false
21	@: command after${:U, with variable expressions expanded}
22