recursive.mk revision 1.2
11.2Srillig# $NetBSD: recursive.mk,v 1.2 2020/08/06 05:52:45 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.1Srillig# whether there are unclosed variables. It might be enough to parse the 91.1Srillig# variable value without VARE_WANTRES 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.1SrilligAM_V_lt = $(am__v_lt_$(V)) 151.1Srilligam__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) 161.1Srilligam__v_lt_0 = --silent 171.1Srilligam__v_lt_1 = 181.2Srillig 191.2Srillig# On 2020-08-06, make reported: "Variable am__v_lt_ is recursive." 201.1SrilliglibXfixes_la_LINK = ... $(AM_V_lt) ... 211.1Srillig 221.1Srillig# somewhere later ... 231.1SrilligAM_DEFAULT_VERBOSITY = 1 241.2Srillig 251.2Srillig 261.2Srillig# The purpose of the -dL flag is to detect unclosed variables. This 271.2Srillig# can be achieved by just parsing the variable and not evaluating it. 281.2Srillig# 291.2Srillig# When the variable is only parsed but not evaluated, bugs in nested 301.2Srillig# variables are not discovered. But these are hard to produce anyway, 311.2Srillig# therefore that's acceptable. In most practical cases, the missing 321.2Srillig# brace would be detected directly in the line where it is produced. 331.2SrilligMISSING_BRACE_INDIRECT:= ${:U\${MISSING_BRACE} 341.2SrilligUNCLOSED = $(MISSING_PAREN 351.2SrilligUNCLOSED = ${MISSING_BRACE 361.2SrilligUNCLOSED = ${MISSING_BRACE_INDIRECT} 371.2Srillig 38