1 # $NetBSD: opt-debug-jobs.mk,v 1.5 2020/11/12 21:54:52 rillig Exp $
3 # Tests for the -dj command line option, which adds debug logging about
4 # running jobs in multiple shells.
8 # Run in parallel mode since the debug logging is more interesting there
13 # Only the actual command is logged.
14 # To see the evaluation of the variable expressions, use -dv.
15 : ${:Uexpanded} expression
17 # Undefined variables expand to empty strings.
18 # Multiple spaces are preserved in the command, as they might be
22 # In the debug output, single quotes are not escaped, even though
23 # the whole command is enclosed in single quotes as well.
24 # This allows to copy and paste the whole command, without having
25 # to unescape anything.
26 : 'single' and "double" quotes
28 # Avoid a race condition in the debug output. Without sleeping,
29 # it is not guaranteed that the two lines "exited/stopped" and
30 # "JobFinish" are output earlier than the stdout of the actual shell
31 # commands. The '@' prefix avoids that this final command gets into
32 # another race condition with the "exited/stopped" line.