On 2007-11-20 11:02Z, Robert P. J. Day wrote:
>   wanted:  a simple way to transform the string (and its entries):
> 
>     -Ia -I/b -Ic -I/d
> 
> to
> 
>     -I/src/a -I/b -I/src/c -I/d
> 
> in short, wherever an entry represents a location that is *not*
> fully-qualified, i want to replace that entry with one that is now
> fully-qualified (and for which i will supply the appropriate prefix).

/tmp[0]$cat subst.make
original := -Ia -I/b -Ic -I/d
modified := $(shell echo $(original) | sed -e 's|-I\([^/]\)|-I/src/\1|g')

.PHONY: all
all:
        @echo original: $(original)
        @echo modified: $(modified)

/tmp[0]$make -f subst.make
original: -Ia -I/b -Ic -I/d
modified: -I/src/a -I/b -I/src/c -I/d

>   is there a simple way to do with one "patsubst" operator?

I don't see how to do it with just one.

> i can see
> a couple obvious ways with "foreach", but the tricky bit is that i'm
> trying to invoke patsubst in places that *don't* match a given pattern
> (that being "-I/").

What transformation do you want for "-I/"?


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to