On Sat, Jun 02, 2007 at 05:25:50AM +0800, [EMAIL PROTECTED] wrote: > Your > reverse = $(2) $(1) > example in the manual is great, however if one day your users happen > to want to quote a comma, > OK:;echo $(call reverse,a,b) > SORRY1:;echo $(call reverse,a\,b,c) > SORRY2:;echo $(call reverse,"a,b",c) > then they are S.O.L. unless you mention how. > > One apparently needs to do > EE=a,b > OK2:;echo $(call reverse,$(EE),c) > > Mention that it is the only(?) way. > > Wait, > OK3:;s=,;echo $(call reverse,a$${s}b,c)
>From info make: Commas and unmatched parentheses or braces cannot appear in the text of an argument as written; leading spaces cannot appear in the text of the first argument as written. These characters can be put into the argument value by variable substitution. First define variables `comma' and `space' whose values are isolated comma and space characters, then substitute these variables where such characters are wanted, like this: comma:= , empty:= space:= $(empty) $(empty) foo:= a b c bar:= $(subst $(space),$(comma),$(foo)) # bar is now `a,b,c'. Here the `subst' function replaces each space with a comma, through the value of `foo', and substitutes the result. Available online here: http://uw713doc.sco.com/cgi-bin/info2html?(make.info)Syntax%2520of%2520Functions&lang=en That should cover it. Sam _______________________________________________ Bug-make mailing list Bug-make@gnu.org http://lists.gnu.org/mailman/listinfo/bug-make