help-make
[Top][All Lists]
Advanced

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

Re: Makefile remaking loop


From: Frank Küster
Subject: Re: Makefile remaking loop
Date: Sat, 12 Mar 2005 18:36:43 +0100
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3 (gnu/linux)

Boris Kolpackov <address@hidden> wrote:

> address@hidden (Frank Küster) writes:
>
>> all: fileB
>>      echo "made $@"
>>      -ls --full-time -l $<
>>
>> fileB: ../fileA
>>      test -e $< && test $< -nt $@ && cp $< $@ || true
>>
>> ../fileA:
>>      true
>>
>> This seems to go well, does anybody still see a problem?
>
> You don't really need the last rule, i.e.,
>
> all: fileB
>       echo "made $@"
>       -ls --full-time -l $<
>
> fileB:
>       test -e $< && test $< -nt $@ && cp $< $@ || true
>
> This will work because make checks if a target (real file, not
> phony) actually changed after the rule's command has completed.
> If the file hasn't changed then make won't update targets that
> happen to depend on this file and otherwise up-to-date. 

But if fileA does not exist, it gives an error:

make: *** No rule to make target `../fileA', needed by `fileB'.  Stop.

And this should not happen; the purpose of this is that I'd like to
update some stuff in my build directories from a directory where I keep
some "common files" for related projects; but this directory will not be
part of the released version of the project, and therefore the files in
it (here ../fileA) are not available when somebody else compiles the
stuff.

Regards, Frank
-- 
Frank Küster
Inst. f. Biochemie der Univ. Zürich
Debian Developer





reply via email to

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