Module Name: src Committed By: rillig Date: Sat Feb 25 00:09:52 UTC 2023
Modified Files: src/usr.bin/make/unit-tests: varname-dot-makeoverrides.exp varname-dot-makeoverrides.mk Log Message: tests/make: test how '$' behaves in .MAKEOVERRIDES and MAKEFLAGS To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 \ src/usr.bin/make/unit-tests/varname-dot-makeoverrides.exp cvs rdiff -u -r1.3 -r1.4 \ src/usr.bin/make/unit-tests/varname-dot-makeoverrides.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/make/unit-tests/varname-dot-makeoverrides.exp diff -u src/usr.bin/make/unit-tests/varname-dot-makeoverrides.exp:1.1 src/usr.bin/make/unit-tests/varname-dot-makeoverrides.exp:1.2 --- src/usr.bin/make/unit-tests/varname-dot-makeoverrides.exp:1.1 Sun Aug 16 12:07:52 2020 +++ src/usr.bin/make/unit-tests/varname-dot-makeoverrides.exp Sat Feb 25 00:09:52 2023 @@ -1 +1,5 @@ +make -r -f varname-dot-makeoverrides.mk dollars_stage_2 DOLLARS='$${varname}' +stage 2: dollars=<${varname}> +make -r -f varname-dot-makeoverrides.mk dollars_stage_3 +stage 3: dollars=<> exit status 0 Index: src/usr.bin/make/unit-tests/varname-dot-makeoverrides.mk diff -u src/usr.bin/make/unit-tests/varname-dot-makeoverrides.mk:1.3 src/usr.bin/make/unit-tests/varname-dot-makeoverrides.mk:1.4 --- src/usr.bin/make/unit-tests/varname-dot-makeoverrides.mk:1.3 Wed Feb 15 06:52:59 2023 +++ src/usr.bin/make/unit-tests/varname-dot-makeoverrides.mk Sat Feb 25 00:09:52 2023 @@ -1,8 +1,18 @@ -# $NetBSD: varname-dot-makeoverrides.mk,v 1.3 2023/02/15 06:52:59 rillig Exp $ +# $NetBSD: varname-dot-makeoverrides.mk,v 1.4 2023/02/25 00:09:52 rillig Exp $ # # Tests for the special .MAKEOVERRIDES variable. -# TODO: Implementation - all: - @:; + @${MAKE} -r -f ${MAKEFILE} dollars_stage_1 + +# Demonstrate that '$' characters are altered when they are passed on to child +# make processes via .MAKEOVERRIDES and MAKEFLAGS. +dollars_stage_1: + ${MAKE} -r -f ${MAKEFILE} dollars_stage_2 DOLLARS='$$$${varname}' + +dollars_stage_2: + @echo 'stage 2: dollars=<${DOLLARS}>' + ${MAKE} -r -f ${MAKEFILE} dollars_stage_3 + +dollars_stage_3: + @echo 'stage 3: dollars=<${DOLLARS}>'