aboutsummaryrefslogtreecommitdiff
path: root/unit-tests/depsrc-optional.mk
blob: f12eeca2b3cb901f267da7a11581200e136c0921 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# $NetBSD: depsrc-optional.mk,v 1.5 2020/11/08 10:33:47 rillig Exp $
#
# Tests for the special source .OPTIONAL in dependency declarations,
# which ignores the target if make cannot find out how to create it.
#
# TODO: Describe practical use cases for this feature.

all: important
	: ${.TARGET} is made.

important: optional optional-cohort
	: ${.TARGET} is made.

optional: .OPTIONAL
	: An optional leaf node is not executed.

# See IsOODateRegular.
optional-cohort:: .OPTIONAL
	: A leaf node using '::' is considered out-of-date.

.MAKEFLAGS: -dm