xref: /freebsd/contrib/bmake/unit-tests/lint.mk (revision 1719886f6d08408b834d270c59ffcfd821c8f63a)
1# $NetBSD: lint.mk,v 1.5 2023/11/19 21:47:52 rillig Exp $
2#
3# Demonstrates stricter checks that are only enabled in lint mode, using the
4# option -dL.
5
6# Before main.c 1.421 from 2020-11-01, make exited successfully even though
7# the error message had been issued as PARSE_FATAL.  This was because back
8# then, make checked for parse errors only after parsing each top-level
9# makefile, in Parse_File.  After that, when expanding expressions
10# in shell commands, the parse errors were not checked again.
11
12# Ouch: as of 2020-08-03, the variable is malformed and parsing stops
13# for a moment, but is continued after the wrongly-guessed end of the
14# variable, which echoes "y@:Q}".
15
16.MAKEFLAGS: -dL
17
18all: mod-loop-varname
19
20mod-loop-varname:
21	@echo ${VAR:Uvalue:@${:Ubar:S,b,v,}@x${var}y@:Q}
22	@echo ${VAR:Uvalue:@!@x$!y@:Q}	# surprisingly allowed
23