On Nov 20, 2007 3:02 AM, Robert P. J. Day <[EMAIL PROTECTED]> 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

Here is a solution but I'm not sure if you will consider it short and sweet.

paths := a /b c /d
abspaths := $(filter /%,$(paths))
relpaths := $(filter-out /%,$(paths))
qual-paths := $(addprefix /src/,$(relpaths)) $(abspaths)
include-paths := $(addprefix -I,$(qual-paths))

$(info paths="$(paths)")
$(info abspaths="$(abspaths)")
$(info relpaths="$(relpaths)")
$(info qual-paths="$(qual-paths)")
$(info include-paths="$(include-paths)")

If your paths already come with -I attached, $(patsubst) can easily
generate $(paths) for you.

   Ken Smith


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

Reply via email to