[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: problems with $$
From: |
PATTON, BILLY \(SBCSI\) |
Subject: |
RE: problems with $$ |
Date: |
Tue, 23 May 2006 09:05:39 -0500 |
This was a very shortened version. the defines are necessary as well as
the evals.
But I got it to work with the subst instead of the patsubst
Thanks for your response.
> -----Original Message-----
> From: John Graham-Cumming [mailto:address@hidden On
> Behalf Of John Graham-Cumming
> Sent: Tuesday, May 23, 2006 9:04 AM
> To: PATTON, BILLY (SBCSI)
> Cc: address@hidden
> Subject: Re: problems with $$
>
>
> PATTON, BILLY (SBCSI) wrote:
> > I have the following example :
> > INCLUDE := -Idogs -Ipigs -Isheep -Irats
> >
> > PC_TO_O = @echo $$(INCLUDE:-I=include\=)
> >
> > .PHONY : x
> >
> > define x
> > x : ; $(PC_TO_O)
> > endef
> > $(eval $(call x))
> >
> > It need to print out
> > include=dogs include=pigs include=sheep include=rats
>
> 1. A substitution reference $(X:A=B) change A to B for each A _at the
> end_ of a word in $(X). Hence your substitution reference
> doesn't work.
> If you fix that your example will work.
>
> PC_TO_O = @echo $$(patsubst -I%,include=%,$(INCLUDE))
>
> 2. I don't think you need $(eval $(call x)) at all. Try doing
>
> INCLUDE := -Idogs -Ipigs -Isheep -Irats
>
> PC_TO_O = @echo $(patsubst -I%,include=%,$(INCLUDE))
>
> .PHONY : x
>
> define x
> x : ; $(PC_TO_O)
> endef
>
> $(x)
>
> 3. Since you only have one line in your rule for x you don't
> need define
>
> INCLUDE := -Idogs -Ipigs -Isheep -Irats
>
> PC_TO_O = @echo $(patsubst -I%,include=%,$(INCLUDE))
>
> .PHONY : x
> x = x : ; $(PC_TO_O)
> $(x)
>
> John.
> --
> John Graham-Cumming
> address@hidden
>
> Home: http://www.jgc.org/
> Blog: http://www.jgc.org/blog/
>
> POPFile: http://getpopfile.org/
> GNU Make Standard Library: http://gmsl.sf.net/
> GNU Make Debugger: http://gmd.sf.net/
> Fast, Parallel Builds: http://www.electric-cloud.com/
>
> Sign up for my Spam and Anti-spam Newsletter
> at http://www.jgc.org/
>
> Help out in the fight against spam
> http://www.spamorham.org/
>