2020-11-07 19:39:21 +00:00
|
|
|
# $NetBSD: varname-dot-newline.mk,v 1.4 2020/10/24 08:46:08 rillig Exp $
|
2020-09-05 16:11:04 +00:00
|
|
|
#
|
|
|
|
# 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}
|
2020-11-07 19:39:21 +00:00
|
|
|
. info The .newline variable cannot be overwritten. Good.
|
2020-09-05 16:11:04 +00:00
|
|
|
.else
|
2020-11-07 19:39:21 +00:00
|
|
|
. info The .newline variable can be overwritten. Just don't do that.
|
2020-09-05 16:11:04 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
# Restore the original value.
|
|
|
|
.newline= ${NEWLINE}
|
|
|
|
|
|
|
|
all:
|
|
|
|
@echo 'first${.newline}second'
|