1 # $NetBSD: deptgt-end-jobs.mk,v 1.1 2020/09/23 03:06:38 rillig Exp $
3 # Tests for the special target .END in dependency declarations,
4 # which is run after making the desired targets.
6 # This test is very similar to deptgt-end.mk, except for the -j option.
7 # This option enables parallel mode, in which the code from job.c partially
8 # replaces the code from compat.c.
10 # Before 2020-08-22, this test crashed with a null pointer dereference.
11 # Before 2020-09-23, this test crashed with an assertion failure.
14 VAR= Should not be expanded.
19 : $@ '$${VAR}' deferred
20 # Oops: The deferred command must not be expanded twice.
21 # The Var_Subst in Compat_RunCommand looks suspicious.
22 # The Var_Subst in JobSaveCommand looks suspicious.
27 : $@ '$${VAR}' deferred
32 : $@ '$${VAR}' deferred
33 # Oops: The deferred command must not be expanded twice.
34 # The Var_Subst in Compat_RunCommand looks suspicious.
35 # The Var_Subst in JobSaveCommand looks suspicious.
37 # The deferred commands are run in the order '.END .BEGIN all'.
38 # This may be unexpected at first since the natural order would be
39 # '.BEGIN all .END', but it is implemented correctly.
41 # At the point where the commands of a node with deferred commands are run,
42 # the deferred commands are appended to the commands of the .END node.
43 # This happens in Compat_RunCommand, and to prevent an endless loop, the
44 # deferred commands of the .END node itself are not appended to itself.
45 # Instead, the deferred commands of the .END node are run as if they were