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: Ken Smith
Subject: Re: how to fully qualify entries in a "-I" list?
Date: Tue, 20 Nov 2007 08:11:57 -0800

On Nov 20, 2007 3:02 AM, Robert P. J. Day <address@hidden> 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




reply via email to

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