xref: /freebsd/contrib/bmake/unit-tests/varmod-quote-dollar.mk (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1# $NetBSD: varmod-quote-dollar.mk,v 1.4 2022/05/08 10:14:40 rillig Exp $
2#
3# Tests for the :q variable modifier, which quotes the string for the shell
4# and doubles dollar signs, to prevent them from being interpreted by a
5# child process of make.
6
7# The newline and space characters at the beginning of this string are passed
8# to the child make.  When the child make parses the variable assignment, it
9# discards the leading space characters.
10ASCII_CHARS=	${.newline} !"\#$$%&'()*+,-./09:;<=>?@AZ[\]^_`az{|}~
11
12all:
13	@${MAKE} -r -f /dev/null \
14	    CHARS=${ASCII_CHARS:q} \
15	    TWICE=${ASCII_CHARS:q}${ASCII_CHARS:q} \
16	    -V CHARS \
17	    -V TWICE
18