1 # $NetBSD: directive-ifmake.mk,v 1.4 2020/08/30 14:25:45 rillig Exp $
3 # Tests for the .ifmake directive, which provides a shortcut for asking
4 # whether a certain target is requested to be made from the command line.
6 # This is the most basic form.
8 .info ok: positive condition works
10 .warning positive condition fails
13 # The not operator works as expected.
14 # An alternative interpretation were that this condition is asking whether
15 # the target "!first" was requested. To distinguish this, see the next test.
19 .info ok: negation works
22 # See if the exclamation mark really means "not", or if it is just part of
25 .info ok: double negation works
27 .warning double negation fails
30 # Multiple targets can be combined using the && and || operators.
31 .ifmake first && second
32 .info ok: both mentioned
34 .warning && does not work as expected
37 # Negation also works in complex conditions.
38 .ifmake first && !unmentioned
39 .info ok: only those mentioned
41 .warning && with ! does not work as expected
44 # Using the .MAKEFLAGS special dependency target, arbitrary command
45 # line options can be added at parse time. This means that it is
46 # possible to extend the targets to be made.
47 .MAKEFLAGS: late-target
49 .info Targets can even be added at parse time.
51 .info No, targets cannot be added at parse time anymore.
54 first second unmentioned late-target: