job-output-long-lines.mk revision 1.3 1 1.3 rillig # $NetBSD: job-output-long-lines.mk,v 1.3 2020/10/24 08:50:17 rillig Exp $
2 1.1 rillig #
3 1.1 rillig # The jobs may produce long lines of output. A practical case are the echoed
4 1.1 rillig # command lines from compiler invocations, with their many -D options.
5 1.1 rillig #
6 1.1 rillig # Each of these lines must be written atomically to the actual output.
7 1.1 rillig # The markers for switching jobs must always be written at the beginning of
8 1.1 rillig # the line, to make them clearly visible in large log files.
9 1.3 rillig #
10 1.1 rillig # As of 2020-09-27, the default job buffer size is 1024. When a job produces
11 1.1 rillig # output lines that are longer than this buffer size, these output pieces are
12 1.1 rillig # not terminated by a newline. Because of this missing newline, the job
13 1.1 rillig # markers "--- job-a ---" and "--- job-b ---" are not always written at the
14 1.1 rillig # beginning of a line, even though this is expected by anyone reading the log
15 1.1 rillig # files.
16 1.1 rillig
17 1.1 rillig .MAKEFLAGS: -j2
18 1.1 rillig
19 1.1 rillig 100:= ${:U1:S,1,2222222222,g:S,2,3333333333,g}
20 1.1 rillig 10000:= ${100:S,3,4444444444,g:S,4,xxxxxxxxxx,g}
21 1.1 rillig
22 1.1 rillig all: job-a job-b
23 1.1 rillig
24 1.1 rillig job-a:
25 1.1 rillig .for i in ${:U:range=100}
26 1.1 rillig @echo ${10000:S,x,a,g}
27 1.1 rillig .endfor
28 1.1 rillig
29 1.1 rillig job-b:
30 1.1 rillig .for i in ${:U:range=100}
31 1.1 rillig @echo ${10000:S,x,b,g}
32 1.1 rillig .endfor
33