freebsd-src/unit-tests/varname-dot-newline.mk
Simon J. Gerraty 302da1a3d3 Import bmake-20201101
Lots of new unit-tests increase code coverage.

Lots of refactoring, cleanup and simlpification to reduce
code size.

Fixes for Bug 223564 and 245807

Updates to dirdeps.mk and meta2deps.py
2020-11-07 19:39:21 +00:00

24 lines
622 B
Makefile

# $NetBSD: varname-dot-newline.mk,v 1.4 2020/10/24 08:46:08 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'