diff options
Diffstat (limited to 'unit-tests/deptgt-ignore.mk')
-rw-r--r-- | unit-tests/deptgt-ignore.mk | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/unit-tests/deptgt-ignore.mk b/unit-tests/deptgt-ignore.mk index 49c14d2cfd43..a0191847e69f 100644 --- a/unit-tests/deptgt-ignore.mk +++ b/unit-tests/deptgt-ignore.mk @@ -1,9 +1,31 @@ -# $NetBSD: deptgt-ignore.mk,v 1.3 2020/11/15 20:20:58 rillig Exp $ +# $NetBSD: deptgt-ignore.mk,v 1.4 2022/01/22 21:50:41 rillig Exp $ # # Tests for the special target .IGNORE in dependency declarations, which # does not stop if a command from this target exits with a non-zero status. +# +# This test only applies to compatibility mode. In jobs mode such as with +# '-j1', all commands for a single target are bundled into a single shell +# program, which is a different implementation technique, the .IGNORE applies +# there as well. + +.MAKEFLAGS: -d0 # force stdout to be unbuffered + +all: depends-on-failed depends-on-ignored +.PHONY: all depends-on-failed depends-on-ignored error-failed error-ignored + +error-failed error-ignored: + @echo '${.TARGET} before' + @false + @echo '${.TARGET} after' + +depends-on-failed: error-failed + @echo 'Making ${.TARGET} from ${.ALLSRC}.' +depends-on-ignored: error-ignored + @echo 'Making ${.TARGET} from ${.ALLSRC}.' -# TODO: Implementation +# Even though the command 'false' in the middle fails, the remaining commands +# are still run. After that, the target is marked made, so targets depending +# on the target with the ignored commands are made. +.IGNORE: error-ignored -all: - @:; +#.MAKEFLAGS: -dg2 |