1 # $NetBSD: cond-op-not.mk,v 1.7 2021/01/19 17:49:13 rillig Exp $
3 # Tests for the ! operator in .if conditions, which negates its argument.
5 # The exclamation mark negates its operand.
10 # Exclamation marks can be chained.
11 # This doesn't happen in practice though.
16 # The ! binds more tightly than the &&.
21 # The operator '==' binds more tightly than '!'.
22 # This is unusual since most other programming languages define the precedence
23 # to be the other way round.
24 .if !${:Uexpression} == "expression"
29 . info Not empty evaluates to true.
31 . info Not empty evaluates to false.
35 . info Not space evaluates to true.
37 . info Not space evaluates to false.
41 . info Not 0 evaluates to true.
43 . info Not 0 evaluates to false.
47 . info Not 1 evaluates to true.
49 . info Not 1 evaluates to false.
53 . info Not word evaluates to true.
55 . info Not word evaluates to false.
58 # A single exclamation mark is a parse error.