Lines Matching +full:ext +full:- +full:gen

1 # $NetBSD: var-scope-local.mk,v 1.11 2024/03/05 23:07:58 rillig Exp $
3 # Tests for target-local variables, such as ${.TARGET} or $@. These variables
4 # are relatively short-lived as they are created just before making the
8 # The 7 built-in target-local variables are listed in the manual page. They
10 # target-local variables can be defined in dependency lines like
15 # Target-local variables in a target rule
20 # expect: target-rule.ext: * = <target-rule.ext>
21 all: target-rule.ext dir/subdir/target-rule.ext
22 target-rule.ext dir/subdir/target-rule.ext: .PHONY
29 .SUFFIXES: .ir-gen-from .ir-from .ir-to
34 # expect: target-rule.ir-gen-from: * = <target-rule>
35 all: target-rule.ir-gen-from dir/subdir/target-rule-dir.ir-gen-from
36 target-rule.ir-gen-from dir/subdir/target-rule-dir.ir-gen-from:
43 .ir-from.ir-to:
49 .ir-gen-from.ir-from:
56 # Target-local variables in an inference rule
57 all: inference-rule.ir-to dir/subdir/inference-rule.ir-to
58 inference-rule.ir-from: .PHONY
59 dir/subdir/inference-rule.ir-from: .PHONY
61 # Target-local variables in a chain of inference rules
62 all: inference-rule-chain.ir-to dir/subdir/inference-rule-chain.ir-to
63 inference-rule-chain.ir-gen-from: .PHONY
64 dir/subdir/inference-rule-chain.ir-gen-from: .PHONY
66 # The run-time 'check' directives from above happen after the parse-time
69 # expect-reset
73 # The target-local variables can be used in expressions, just like other
76 # these expressions to expand right in time when the target-local variables
82 # see the command line option '-e'). In that phase, expressions involving
83 # target-local variables need to be preserved, including the exact names of
86 # Each of the built-in target-local variables has two equivalent names, for
89 # This aliasing happens for single-character variable names like $@ or $<
94 # In the following condition, make expands '$@' to the long-format alias
101 # In the long form of writing a target-local variable, the text of the
114 # text is used instead. This preserves the expressions based on target-local
119 # In the following examples, the expressions are based on target-local
140 # Additional target-local variables may be defined in dependency lines.
141 .MAKEFLAGS: -dv
145 # assignment, the left-hand side must be a single word or empty.
153 # line is parsed as a variable assignment since its left-hand side is a single
157 .MAKEFLAGS: -d0
162 # One of the dynamic target-local variables is '.TARGET'. Since this is not
164 # expect: : Making var-scope-local.c out of nothing.
165 var-scope-local.c:
170 # expect: : Making var-scope-local.o from var-scope-local.c.
171 # expect: : Making basename "var-scope-local.o" in "." from "var-scope-local.c" in ".".
180 all: var-scope-local.o
182 # 'all', not in the global scope. This can be seen with the -dv
187 # Begin tests for custom target-local variables, for all 5 variable assignment
189 all: var-scope-local-assign.o
190 all: var-scope-local-append.o
191 all: var-scope-local-append-global.o
192 all: var-scope-local-default.o
193 all: var-scope-local-subst.o
194 all: var-scope-local-shell.o
196 var-scope-local-assign.o \
197 var-scope-local-append.o \
198 var-scope-local-append-global.o \
199 var-scope-local-default.o \
200 var-scope-local-subst.o \
201 var-scope-local-shell.o:
204 # Target-local variables are enabled by default. Force them to be enabled
216 # expect-reset
217 # expect: Making var-scope-local-assign.o with make 'local' and env 'local'.
218 var-scope-local-assign.o: VAR= local
222 var-scope-local-append.o: VAR+= local
223 # Once a variable is defined in the target-local scope, appending using '+='
227 # expect: Making var-scope-local-append.o with make 'local to var-scope-local-append.o' and env 'local to var-scope-local-append.o'.
228 var-scope-local-append.o: VAR += to ${.TARGET}
237 # expect: Making var-scope-local-append-global.o with make 'global+local' and env 'global+local'.
238 var-scope-local-append-global.o: VAR= ${VAR}+local
240 var-scope-local-default.o: VAR ?= first
241 var-scope-local-default.o: VAR ?= second
242 # XXX: '?=' does look at the global variable. That's a long-standing
245 # expect: Making var-scope-local-default.o with make 'global' and env 'global'.
253 # expect: Making var-scope-local-subst.o with make 'global+local' and env 'global+local'.
254 var-scope-local-subst.o: VAR := $${VAR}+local
259 var-scope-local-shell.o: VAR != echo output
265 # expect: Making .USE var-scope-local-use.o with make 'global' and env 'global'.
269 all: var-scope-local-use.o
270 var-scope-local-use.o: a_use