xref: /freebsd/contrib/bmake/unit-tests/opt-keep-going.mk (revision 7fdf597e96a02165cfe22ff357b857d5fa15ed8a)
1# $NetBSD: opt-keep-going.mk,v 1.6 2020/12/07 00:53:30 rillig Exp $
2#
3# Tests for the -k command line option, which stops building a target as soon
4# as an error is detected, but continues building the other, independent
5# targets, as far as possible.
6#
7# Until 2020-12-07, if a dependency of the main target failed, the exit
8# status was nevertheless 0, which was wrong since the main targets could
9# not be made.  This was only wrong in -k mode combined with compat mode.
10
11.MAKEFLAGS: -d0			# switch stdout to being line-buffered
12.MAKEFLAGS: -k
13
14all: dependency other
15
16dependency:
17	@echo dependency 1
18	@false
19	@echo dependency 2
20	@:; exit 7
21	@echo dependency 3
22
23other:
24	@echo other 1
25	@false
26	@echo other 2
27
28all:
29	@echo main 1
30	@false
31	@echo main 2
32