1 1.2 rillig # $NetBSD: opt-debug-errors.mk,v 1.2 2020/09/06 04:35:03 rillig Exp $ 2 1.1 rillig # 3 1.1 rillig # Tests for the -de command line option, which adds debug logging for 4 1.1 rillig # failed commands and targets. 5 1.1 rillig 6 1.2 rillig .MAKEFLAGS: -de 7 1.1 rillig 8 1.2 rillig all: fail-spaces 9 1.2 rillig all: fail-escaped-space 10 1.2 rillig all: fail-newline 11 1.2 rillig all: fail-multiline 12 1.2 rillig all: fail-multiline-intention 13 1.2 rillig 14 1.2 rillig # XXX: The debug output folds the spaces, showing '3 spaces' instead of 15 1.2 rillig # the correct '3 spaces'. 16 1.2 rillig fail-spaces: 17 1.2 rillig echo '3 spaces'; false 18 1.2 rillig 19 1.2 rillig # XXX: The debug output folds the spaces, showing 'echo \ indented' instead 20 1.2 rillig # of the correct 'echo \ indented'. 21 1.2 rillig fail-escaped-space: 22 1.2 rillig echo \ indented; false 23 1.2 rillig 24 1.2 rillig # XXX: A newline is turned into an ordinary space in the debug log. 25 1.2 rillig fail-newline: 26 1.2 rillig echo 'line1${.newline}line2'; false 27 1.2 rillig 28 1.2 rillig # The line continuations in multiline commands are turned into an ordinary 29 1.2 rillig # space before the command is actually run. 30 1.2 rillig fail-multiline: 31 1.2 rillig echo 'line1\ 32 1.2 rillig line2'; false 33 1.2 rillig 34 1.2 rillig # It is a common style to align the continuation backslashes at the right 35 1.2 rillig # of the lines, usually at column 73. All spaces before the continuation 36 1.2 rillig # backslash are preserved and are usually outside a shell word and thus 37 1.2 rillig # irrelevant. Having these spaces collapsed makes sense to show the command 38 1.2 rillig # in its condensed form. 39 1.2 rillig # 40 1.2 rillig fail-multiline-intention: 41 1.2 rillig echo 'word1' \ 42 1.2 rillig 'word2'; false 43