help-make
[Top][All Lists]
Advanced

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

Re: how to fully qualify entries in a "-I" list?


From: Greg Chicares
Subject: Re: how to fully qualify entries in a "-I" list?
Date: Tue, 20 Nov 2007 14:33:38 +0000
User-agent: Thunderbird 2.0.0.6 (Windows/20070728)

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/"?




reply via email to

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