Hi Eric, * Eric Blake wrote on Thu, Dec 02, 2010 at 08:21:13PM CET: > On 12/02/2010 12:10 PM, Ralf Wildenhues wrote: > > I'm not sure if it was mentioned before in the discussion, but > > portability-wise, there is a difference between one level of recursion > > and arbitrary many. IIRC then IRIX make only supported one level, i.e., > > $(var1$(var2$(var3))) > > > > was erroneous, but > > $(var1$(var2)) > > > > was not. Also, with a one-character variable X > > $(var$X) > > > > was erroneous with at least one legacy make implementation (but I think > > it was more than one); but > > $(var$(X)) > > > > worked. > > > > If you like, I can go back and verify the details. > > Yes please, and I will feed that information back to the Austin Group.
Thank you. Here we go. With the following Makefile, V = v V1 = v1 V11 = v11 O = 1 ONE = 1 O1 = 11 Vr1 = $(V$(O)) Vr2 = $(V$(ONE)) Vr3 = $(V$(Z)) Vr4 = $(V$O) Vr5 = $(V$Z) Vrr1 = $(V$(O$(Z))) Vrr2 = $(V$(O$(O))) Vrr3 = $(V$(Z$(Z))) Vrr4 = $(V$(O$Z)) Vrr5 = $(V$(Z$Z)) R = R Vrrr = $($($($($($($($($($($($($($(R)))))))))))))) all_FLAGS = bar all: @echo $(Vr1), $(Vr2), $(Vr3) @echo $(Vrr1), $(Vrr2), $(Vrr3) @echo $(Vrrr) @echo $(Vr4), $(Vr5) @echo $(Vrr4), $(Vrr5) @echo $($...@_flags) @echo $($(@)_FLAGS) the make implementations from AIX 5.2, 5.3, 6.1, 7.1 Darwin 10.4.0 (GNU make 3.81) FreeBSD 6.4, 7.1 GNU HP-UX 10.20, 11.00, 11.11, 11.23, 11.31 NetBSD 5.99.39 OpenBSD 4.4 Solaris 2.6, 7, 8, 9, 10 Tru64 OSF 5.1D all print: v1, v1, v v1, v11, v R v1, v v1, v bar bar IRIX 6.5 make fails over each expansion in output lines 5, 6, and 7, e.g.: v1, v1, v v1, v11, v R UX:make: ERROR: Unmatched closing curly braces or parenthesis in line containing: $(V$O). The last line containing $($(@)_FLAGS) is wrongly expanded to empty by this make. So, in summary, the parenthesization is an issue, and expanding of the automatic $@ variable recursively. I haven't tried to determine whether there is an upper limit to recursive expansion (should I?). See also this old thread: <http://thread.gmane.org/gmane.comp.sysutils.automake.general/9943/focus=9945> Cheers, Ralf