xref: /freebsd/contrib/bmake/unit-tests/deptgt-error.mk (revision 9f45a3c8c82ffead7044ae836d9257113c630d3b)
1# $NetBSD: deptgt-error.mk,v 1.4 2022/01/22 21:50:41 rillig Exp $
2#
3# Tests for the special target .ERROR in dependency declarations, which
4# is made when another target fails.
5
6all: .PHONY
7	false fails
8
9.ERROR:
10	@echo 'Making ${.TARGET} out of nothing.'
11
12.ERROR: sub-error
13sub-error: .PHONY
14	@echo 'Making ${.TARGET} as prerequisite.'
15
16# Before making the '.ERROR' target, these variable values are printed.
17MAKE_PRINT_VAR_ON_ERROR=	ERROR_INFO
18
19# Use single quotes to demonstrate that the output is only informational, it
20# does not use any established escaping mechanism.
21ERROR_INFO=	This information is ${:Uprinted} on 'errors'.
22