[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Makefile and VPATH
From: |
Odne Helleb� |
Subject: |
Re: Makefile and VPATH |
Date: |
Mon, 26 Jan 2015 07:11:10 +0100 |
Technically its not that I want make to guess, but I wanted it to
follow the rules sequentially, not read it all at once :)
Thanks for your explanation and especially for your link, it was
interesting. If you've got any other links please send.
Med vennlig hilsen
Odne Hellebø
On 26 January 2015 at 05:19, Paul Smith <address@hidden> wrote:
> On Mon, 2015-01-26 at 04:15 +0100, Odne Helleb� wrote:
>> I've narrowed my problem down to this makefile:
>>
>> VPATH = folder
>> > all : test
>> >
>> > test : foo
>> > echo $<
>> >
>> > foo :
>> > touch folder/foo
>> >
>> (with formatting here http://sprunge.us/ifWI )
>> doing make twice will echo foo and then folder/foo, but I was hoping that
>> it would be possible to get make to expand rule 3 first so that rule 2
>> always give folder/foo
>
> That's not how VPATH works. How should make guess that this is what you
> want to happen?
>
> It turns out that VPATH is only useful for finding _source files_ (that
> is, files that exist before make starts), not files that are created by
> make as the result of running rules.
>
> It might be helpful to read this:
> http://make.mad-scientist.net/papers/how-not-to-use-vpath/
>
>