bug-make
[Top][All Lists]
Advanced

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

Re: feature request - order only deps


From: Sebastian Pipping
Subject: Re: feature request - order only deps
Date: Sat, 02 Feb 2013 18:14:25 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130113 Thunderbird/17.0.2

On 02.02.2013 16:19, Matěj Týč wrote:
>> This is what I understand to be our current Makefile:
>>
>>   bar_deps = foo1 foo2
>>
>>   bar: $(bar_deps)
>>
>>   $(bar_deps): | cache-foo
>>
>>   %:
>>      touch $@
> [..]
> 
> Thank you for your quick help, your example indeed works, but it has one
> weakness.
> Consider a case when eg. 'foo1' depends on 'baz' and suddenly 'baz' is
> updated, so 'foo1' should be updated, too.
> However, the old 'foo1' is still there, so the 'file_missing' function
> assumes that nothing has to be done => cache-foo is not needed, which is
> not true.
> 
> Since I generate the makefile using some M4sugar macros, I don't mind
> having to write some extra stuff; however now the workaround path seems
> to complicate quite a lot...

How about something like this?

  bar_deps = foo1 foo2

  bar: $(bar_deps)

  $(bar_deps):
        $(MAKE) cache-foo
        touch $@

  %:
        touch $@

Now cache-foo is remade iff at least one of $(bar_deps) needs a rebuild.

Best,



Sebastian




reply via email to

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