1 # $NetBSD: deptgt-delete_on_error.mk,v 1.3 2020/10/25 21:31:00 rillig Exp $
3 # Tests for the special target .DELETE_ON_ERROR in dependency declarations,
4 # which controls whether the target is deleted if a shell command fails or
7 # In compatibility mode, regular and phony targets are deleted, but precious
8 # targets are preserved.
10 # In parallel mode, regular targets are deleted, while phony and precious
11 # targets are preserved.
17 THIS= deptgt-delete_on_error
18 TARGETS= ${THIS}-regular ${THIS}-regular-delete
19 TARGETS+= ${THIS}-phony ${THIS}-phony-delete
20 TARGETS+= ${THIS}-precious ${THIS}-precious-delete
24 @echo 'Compatibility mode'
25 @-${.MAKE} -f ${MAKEFILE} -k ${TARGETS}
29 @-${.MAKE} -f ${MAKEFILE} -k -j1 ${TARGETS}
32 ${THIS}-regular{,-delete}:
35 ${THIS}-phony{,-delete}: .PHONY
38 ${THIS}-precious{,-delete}: .PRECIOUS
41 # The special target .DELETE_ON_ERROR is a global setting.
42 # It does not apply to single targets.
43 # The following line is therefore misleading but does not generate any
44 # warning or even an error message.
45 .DELETE_ON_ERROR: ${TARGETS:M*-delete}