opt-debug-parse.mk revision 1.7 1 # $NetBSD: opt-debug-parse.mk,v 1.7 2022/02/09 21:09:24 rillig Exp $
2 #
3 # Tests for the -dp command line option, which adds debug logging about
4 # makefile parsing.
5
6 .MAKEFLAGS: -dp
7
8 # TODO: Implementation
9
10 # Before parse.c 1.639 from 2022-01-08, PrintStackTrace and other diagnostics
11 # printed a wrong line number, using the last line before the loop body, while
12 # it should rather be the line number where the .for loop starts.
13 #
14 # Before parse.c 1.643 from 2022-01-08, PrintStackTrace tried to be too clever
15 # by merging stack trace entries, printing confusing line numbers as a result.
16 .for \
17 var \
18 in \
19 value
20 .info trace with multi-line .for loop head
21 .endfor
22
23 # Before parse.c 1.641 from 2022-01-08, the debug log said it returned to
24 # the line of the '.include' instead of the line following it.
25 .include "/dev/null"
26
27
28 # In .for loops with multiple variables, the variable details are included in
29 # the stack trace, just as with a single variable.
30 .for a b c in 1 2 3 ${:U4 5 6}
31 .info trace
32 .endfor
33
34
35 .MAKEFLAGS: -d0
36
37 all: .PHONY
38