recursive.mk revision 1.5
11.5Srillig# $NetBSD: recursive.mk,v 1.5 2021/03/15 12:15:03 rillig Exp $
21.1Srillig#
31.1Srillig# In -dL mode, a variable may get expanded before it makes sense.
41.1Srillig# This would stop make from doing anything since the "recursive" error
51.1Srillig# is fatal and exits immediately.
61.1Srillig#
71.1Srillig# The purpose of evaluating that variable early was just to detect
81.5Srillig# whether there are unclosed variables.  The variable value is therefore
91.5Srillig# parsed with VARE_PARSE_ONLY for that purpose.
101.1Srillig#
111.1Srillig# Seen in pkgsrc/x11/libXfixes, and probably many more package that use
121.1Srillig# GNU Automake.
131.1Srillig
141.4Srillig.MAKEFLAGS: -dL
151.4Srillig
161.3SrilligAM_V_lt=	${am__v_lt_${V}}
171.3Srilligam__v_lt_=	${am__v_lt_${AM_DEFAULT_VERBOSITY}}
181.3Srilligam__v_lt_0=	--silent
191.3Srilligam__v_lt_1=
201.2Srillig
211.2Srillig# On 2020-08-06, make reported: "Variable am__v_lt_ is recursive."
221.3SrilliglibXfixes_la_LINK=	... ${AM_V_lt} ...
231.1Srillig
241.1Srillig# somewhere later ...
251.3SrilligAM_DEFAULT_VERBOSITY=	1
261.2Srillig
271.2Srillig
281.2Srillig# The purpose of the -dL flag is to detect unclosed variables.  This
291.2Srillig# can be achieved by just parsing the variable and not evaluating it.
301.2Srillig#
311.2Srillig# When the variable is only parsed but not evaluated, bugs in nested
321.2Srillig# variables are not discovered.  But these are hard to produce anyway,
331.2Srillig# therefore that's acceptable.  In most practical cases, the missing
341.2Srillig# brace would be detected directly in the line where it is produced.
351.2SrilligMISSING_BRACE_INDIRECT:=	${:U\${MISSING_BRACE}
361.3SrilligUNCLOSED=	$(MISSING_PAREN
371.3SrilligUNCLOSED=	${MISSING_BRACE
381.3SrilligUNCLOSED=	${MISSING_BRACE_INDIRECT}
39