summaryrefslogtreecommitdiff
path: root/unit-tests/varname-dot-newline.mk
blob: fa9ac075964932f1b5a1125f08916a5316029939 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# $NetBSD: varname-dot-newline.mk,v 1.3 2020/08/19 05:51:18 rillig Exp $
#
# Tests for the special .newline variable.
#
# Contrary to the special variable named "" that is used in expressions like
# ${:Usome-value}, the variable ".newline" is not protected against
# modification.  Nobody exploits that though.

NEWLINE:=	${.newline}

.newline=	overwritten

.if ${.newline} == ${NEWLINE}
.info The .newline variable cannot be overwritten.  Good.
.else
.info The .newline variable can be overwritten.  Just don't do that.
.endif

# Restore the original value.
.newline=	${NEWLINE}

all:
	@echo 'first${.newline}second'