help-make
[Top][All Lists]
Advanced

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

Re: Makefile remaking loop


From: Boris Kolpackov
Subject: Re: Makefile remaking loop
Date: Wed, 9 Mar 2005 10:31:38 +0000 (UTC)
User-agent: nn/6.6.5+RFC1522

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. You can
read more about this here:

http://kolpackov.net/pipermail/notes/2004-September/000011.html

hth,
-boris





reply via email to

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