]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/bmake/unit-tests/varname-dot-newline.mk
Update to bmake-20201101
[FreeBSD/FreeBSD.git] / contrib / bmake / unit-tests / varname-dot-newline.mk
1 # $NetBSD: varname-dot-newline.mk,v 1.4 2020/10/24 08:46:08 rillig Exp $
2 #
3 # Tests for the special .newline variable.
4 #
5 # Contrary to the special variable named "" that is used in expressions like
6 # ${:Usome-value}, the variable ".newline" is not protected against
7 # modification.  Nobody exploits that though.
8
9 NEWLINE:=       ${.newline}
10
11 .newline=       overwritten
12
13 .if ${.newline} == ${NEWLINE}
14 .  info The .newline variable cannot be overwritten.  Good.
15 .else
16 .  info The .newline variable can be overwritten.  Just don't do that.
17 .endif
18
19 # Restore the original value.
20 .newline=       ${NEWLINE}
21
22 all:
23         @echo 'first${.newline}second'