2022-02-05 20:03:50 +00:00
|
|
|
# $NetBSD: deptgt-ignore.mk,v 1.4 2022/01/22 21:50:41 rillig Exp $
|
2020-09-05 16:11:04 +00:00
|
|
|
#
|
2020-11-20 03:54:37 +00:00
|
|
|
# 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.
|
2022-02-05 20:03:50 +00:00
|
|
|
#
|
|
|
|
# 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}.'
|
2020-09-05 16:11:04 +00:00
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
# 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
|
2020-09-05 16:11:04 +00:00
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
#.MAKEFLAGS: -dg2
|