xref: /freebsd/contrib/bmake/unit-tests/deptgt-error.mk (revision e0c4386e7e71d93b0edc0c8fa156263fc4a8b0b6)
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