help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: function call arguments


From: ali hagigat
Subject: Re: function call arguments
Date: Wed, 27 Apr 2011 15:44:23 +0430

I tested the following:
all: ;
var1=$(subst this,that,this is  a,      text)
$(warning $(var1))
makefile28:3: that is  a,      text
make: `all' is up to date.
-----------------------------
Why the result seems OK and expected while "subst"  function seems to get 4
arguments?

2011/4/27 Semen Trygubenko <address@hidden>

> 2011/4/27 ali hagigat <address@hidden>:
> > 8.1 Function Call Syntax
> > Commas and unmatched parentheses or braces cannot appear in the text
> > of an argument
> > written;
> > -------------------------------
> > var= this,is a    text
> > all: ;
> > var1=$(subst this,that,$(var))
> > $(warning $(var1))
> >
> > makefile28:4: that,is a    text
> > make: `all' is up to date.
> > ---------------------------------
> > Why  "," was used successfully then?
>
> Because "," appears in the right hand side of a variable "var"
> definition and not in the argument to $(subst ) function.
> If you were to write $(subst this,that,this,is a    text) "this,is a
>  text" will be parsed as two arguments to $(subst ) function because
> of "," delimiter ...
>
> HTH
>
>
> --
> Семен
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]