This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

modification time disorder: touch-related?


In running Make, I find targets being remade that shouldn't have to be
remade; being considered younger than the prerequisites from which
they've just been made.  It seems to happen especially with
prerequisites created by `touch`:  e.g.:

    $ cat Makefile
    all : bar baz

    bar baz : foo
            cp $< $@

    foo :
            touch $@

    $ rm foo bar baz
    $ make
    touch foo
    cp foo bar
    cp foo baz
    $ make
    cp foo bar
    cp foo baz
    $ make
    cp foo bar
    cp foo baz
    $ make
    cp foo bar
    cp foo baz
    $ make
    cp foo bar
    cp foo baz
    $ make
    cp foo bar
    $ make
    make: Nothing to be done for `all'.

Sleeping helps, but you have to sleep for quite a while; even 2 seconds
may not be enough:

    $ cat Makefile
    all : bar baz

    bar baz : foo
            cp $< $@

    foo :
            touch $@ && sleep 2

    $ rm foo bar baz
    $ make
    touch foo && sleep 2
    cp foo bar
    cp foo baz
    $ make
    cp foo bar
    cp foo baz
    $ make
    cp foo bar
    cp foo baz
    $ make
    make: Nothing to be done for `all'.

The modification time disorder can be seen too in files created
directly from the command line:

    $ rm foo bar baz qux
    $ touch foo
    $ cp foo bar
    $ cp foo baz
    $ cp foo qux
    $ ls -rt
    bar  baz  qux  foo

But where its hurting is with files created by 'touch' or 'cp' under
Make control, that are prerequisites to slow-to-make targets.

-- 
rmd

Attachment: cygcheck.out
Description: Text document

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]