1 # $NetBSD: cond-cmp-string.mk,v 1.3 2020/08/20 18:43:19 rillig Exp $
3 # Tests for string comparisons in .if conditions.
5 # This is a simple comparison of string literals.
6 # Nothing surprising here.
11 # The right-hand side of the comparison may be written without quotes.
16 # The left-hand side of the comparison must be enclosed in quotes.
17 # This one is not enclosed in quotes and thus generates an error message.
22 # The left-hand side of the comparison requires a defined variable.
23 # The variable named "" is not defined, but applying the :U modifier to it
24 # makes it "kind of defined" (see VAR_KEEP). Therefore it is ok here.
29 # Any character in a string literal may be escaped using a backslash.
30 # This means that "\n" does not mean a newline but a simple "n".
31 .if "string" != "\s\t\r\i\n\g"
35 # It is not possible to concatenate two string literals to form a single
37 .if "string" != "str""ing"