1 # $NetBSD: deptgt-end.mk,v 1.6 2020/10/23 19:28:17 rillig Exp $
3 # Tests for the special target .END in dependency declarations,
4 # which is run after making the desired targets.
6 VAR= Should not be expanded.
11 : $@ '$${VAR}' deferred
12 # Oops: The deferred command must not be expanded twice.
13 # The Var_Subst in Compat_RunCommand looks suspicious.
14 # The Var_Subst in JobSaveCommand looks suspicious.
19 : $@ '$${VAR}' deferred
21 # The .END node can define dependencies, just like a regular target.
26 : $@ '$${VAR}' deferred
31 : $@ '$${VAR}' deferred
32 # Oops: The deferred command must not be expanded twice.
33 # The Var_Subst in Compat_RunCommand looks suspicious.
34 # The Var_Subst in JobSaveCommand looks suspicious.
36 # The deferred commands are run in the order '.END .BEGIN all'.
37 # This may be unexpected at first since the natural order would be
38 # '.BEGIN all .END', but it is implemented correctly.
40 # At the point where the commands of a node with deferred commands are run,
41 # the deferred commands are appended to the commands of the .END node.
42 # This happens in Compat_RunCommand, and to prevent an endless loop, the
43 # deferred commands of the .END node itself are not appended to itself.
44 # Instead, the deferred commands of the .END node are run as if they were