Home | History | Annotate | Line # | Download | only in unit-tests
cmd-errors-lint.mk revision 1.2
      1 # $NetBSD: cmd-errors-lint.mk,v 1.2 2024/04/23 22:51:28 rillig Exp $
      2 #
      3 # Demonstrate how errors in expressions affect whether the commands
      4 # are actually executed.
      5 
      6 .MAKEFLAGS: -dL
      7 
      8 all: undefined unclosed-expression unclosed-modifier unknown-modifier end
      9 
     10 # Undefined variables in expressions are not an error.  They expand to empty
     11 # strings.
     12 undefined:
     13 	: $@ ${UNDEFINED}
     14 
     15 # XXX: As of 2020-11-01, this obvious syntax error is not detected.
     16 # XXX: As of 2020-11-01, this command is executed even though it contains
     17 # parse errors.
     18 unclosed-expression:
     19 	: $@ ${UNCLOSED
     20 
     21 # XXX: As of 2020-11-01, this obvious syntax error is not detected.
     22 # XXX: As of 2020-11-01, this command is executed even though it contains
     23 # parse errors.
     24 unclosed-modifier:
     25 	: $@ ${UNCLOSED:
     26 
     27 # XXX: As of 2020-11-01, this command is executed even though it contains
     28 # parse errors.
     29 unknown-modifier:
     30 	: $@ ${UNKNOWN:Z}
     31 
     32 end:
     33 	: $@
     34