help-make
[Top][All Lists]
Advanced

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

Re: Exact paths vs canonical paths


From: Angel Tsankov
Subject: Re: Exact paths vs canonical paths
Date: Mon, 25 Oct 2010 15:33:43 +0300
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4

On 10/25/2010 01:02 PM, Eli Zaretskii wrote:
Date: Mon, 25 Oct 2010 12:18:39 +0300
From: Angel Tsankov<address@hidden>
Newsgroups: gmane.comp.gnu.make.general
CC: address@hidden

./a.out: a.o
        @echo $@  # Prints a.out instead of ./a.out

[...]

So what is the difference between "a.out" and "./a.out" that makes you
need the latter?

I need ./a.out in a call to patsubst like this one:

$(PATH_TO_OBJECTS)/%.o: ...
        # Get source file that corresponds to an object file
        $(patsubst $(PATH_TO_OBJECTS)/%.o,$(PATH_TO_SOURCES)/%.c,$@))

The problem occurs when PATH_TO_OBJECTS starts with './', e.g. './objects' Then $@ returns just 'objects' and the call to patsubst fails.


Regards,
Angel Tsankov




reply via email to

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