2022-07-26 15:52:53 +00:00
|
|
|
# $NetBSD: compat-error.mk,v 1.5 2022/05/08 06:51:27 rillig Exp $
|
2021-01-14 01:24:34 +00:00
|
|
|
#
|
|
|
|
# Test detailed error handling in compat mode.
|
|
|
|
#
|
2022-07-26 15:52:53 +00:00
|
|
|
# Make several targets that alternately succeed and fail.
|
2021-01-14 01:24:34 +00:00
|
|
|
#
|
2022-07-26 15:52:53 +00:00
|
|
|
# The first failing top-level target is recorded in '.ERROR_TARGET'. While
|
|
|
|
# this information may give a hint as to which target failed, it would be more
|
|
|
|
# useful at that point to know the actual target that failed, or the complete
|
|
|
|
# chain from root cause to top-level target.
|
|
|
|
#
|
|
|
|
# Historic bugs
|
|
|
|
# Before compat.c 1.215 from 2020-12-13, '.ERROR_TARGET' was 'success3',
|
|
|
|
# which was obviously wrong.
|
|
|
|
#
|
|
|
|
# Bugs
|
|
|
|
# As of 2020-12-13, '.ERROR_CMD' is empty, which does not provide any
|
|
|
|
# insight into the command that actually failed.
|
2021-01-14 01:24:34 +00:00
|
|
|
#
|
|
|
|
# See also:
|
2022-07-26 15:52:53 +00:00
|
|
|
# Compat_MakeAll
|
2021-01-14 01:24:34 +00:00
|
|
|
#
|
|
|
|
# The commit that added the NULL command to gn->commands:
|
|
|
|
# CVS: 1994.06.06.22.45.??
|
|
|
|
# Git: 26a8972fd7f982502c5fbfdabd34578b99d77ca5
|
|
|
|
# 1994: Lst_Replace (cmdNode, (ClientData) NULL);
|
|
|
|
# 2020: LstNode_SetNull(cmdNode);
|
|
|
|
#
|
|
|
|
# The commit that skipped NULL commands for .ERROR_CMD:
|
2022-07-26 15:52:53 +00:00
|
|
|
# CVS: 2016.08.11.19.53.17
|
2021-01-14 01:24:34 +00:00
|
|
|
# Git: 58b23478b7353d46457089e726b07a49197388e4
|
|
|
|
|
2022-07-26 15:52:53 +00:00
|
|
|
.MAKEFLAGS: -k success1 fail1 success2 fail2 success3
|
2021-01-14 01:24:34 +00:00
|
|
|
|
|
|
|
success1 success2 success3:
|
|
|
|
: Making ${.TARGET} out of nothing.
|
|
|
|
|
|
|
|
fail1 fail2:
|
|
|
|
: Making ${.TARGET} out of nothing.
|
|
|
|
false '${.TARGET}' '$${.TARGET}' '$$$${.TARGET}'
|
|
|
|
|
|
|
|
.ERROR:
|
|
|
|
@echo ${.TARGET} target: '<'${.ERROR_TARGET:Q}'>'
|
|
|
|
@echo ${.TARGET} command: '<'${.ERROR_CMD:Q}'>'
|