help-make
[Top][All Lists]
Advanced

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

Re: macros in macro substitution


From: Aleksandar Uzelac
Subject: Re: macros in macro substitution
Date: Sat, 18 Nov 2006 00:00:26 +0100

  philip,

  thanks alot for the answer, you were right, i read some nmake book on the 
subject instead. never heard of the patsubst function.

  uzi

Friday, November 17, 2006, 9:01:09 PM, you wrote:

> On 11/17/06, Aleksandar Uzelac <address@hidden> wrote:

>>    this will work alright: OBJECTS=$(SOURCES:.c=.o)
>>    but i would need something like this:
>>        OBJECTS=$(TARGETPATH)/$(SOURCES:.c=.o $(TARGETPATH)/)

> So, you want to replace
>    %.c
> with
>    $(TARGETPATH)/%.o

> right?  As described in the GNU make info pages (you _have_ read
> through them, right?), you can do that using the patsubst function:

>    OBJECTS = $(patsubst $(SOURCES),%.c,$(TARGETPATH)/%.o)

> That can also be written as:
>    OBJECTS=$(SOURCES:%.c=$(TARGETPATH)/%.o)


> Philip Guenther





reply via email to

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