xref: /freebsd/contrib/bmake/unit-tests/depsrc-optional.mk (revision 643ac419fafba89f5adda0e0ea75b538727453fb)
1# $NetBSD: depsrc-optional.mk,v 1.5 2020/11/08 10:33:47 rillig Exp $
2#
3# Tests for the special source .OPTIONAL in dependency declarations,
4# which ignores the target if make cannot find out how to create it.
5#
6# TODO: Describe practical use cases for this feature.
7
8all: important
9	: ${.TARGET} is made.
10
11important: optional optional-cohort
12	: ${.TARGET} is made.
13
14optional: .OPTIONAL
15	: An optional leaf node is not executed.
16
17# See IsOODateRegular.
18optional-cohort:: .OPTIONAL
19	: A leaf node using '::' is considered out-of-date.
20
21.MAKEFLAGS: -dm
22