1 # $NetBSD: deptgt-makeflags.mk,v 1.4 2020/10/23 14:48:49 rillig Exp $
3 # Tests for the special target .MAKEFLAGS in dependency declarations,
4 # which adds command line options later, at parse time.
6 # The -D option sets a variable in the "Global" scope and thus can be
26 .MAKEFLAGS: VAR="value"' with'\ spaces
28 .if ${VAR} != "value with spaces"
32 # Variables set on the command line as VAR=value are placed in the
33 # "Command" scope and thus cannot be undefined.
36 .if ${VAR} != "value with spaces"
40 # When parsing this line, each '$$' becomes '$', resulting in '$$$$'.
41 # This is assigned to the variable DOLLAR.
42 # In the condition, that variable is expanded, and at that point, each '$$'
43 # becomes '$' again, the final expression is thus '$$'.
45 .MAKEFLAGS: DOLLAR=$$$$$$$$
46 .if ${DOLLAR} != "\$\$"