I'm seeing an intermittent (i.e. two consecutive invocations
can be different) results when I have a command which
produces two targets.  It occurs when both targets are 
themselves given as dependencies of the same higher target.
The error is reported as Clock skew, but I'm
running on a single system.  The behaviour is sensitive to
a delay inserted after the command which creates the two
targets in question. I've enclosed an example.

Here are the details:

sli4515:tommyk> cat Makefile
default : clean foo bar

foo bar :
        touch foo bar
        sleep 1

clean :
        rm -f foo bar
sli4515:tommyk> make -f weetest.mk
rm -f foo bar
touch foo bar
sleep 1
sli4515:tommyk> make -f weetest.mk
rm -f foo bar
touch foo bar
sleep 1
make: *** Warning: File `bar' has modification time in the future (2000-08-03 14:52:59 
> 2000-08-03 14:52:58)
make: *** Warning:  Clock skew detected.  Your build may be incomplete.
sli4515:tommyk> 

With the "sleep 1" in place, the "Warning" happens about one 
in every three invocations of make.  If I remove the "sleep 1"
the Warning happens every time.  If I increase the sleep to 2 the
problem goes away (well, it didn't happen in the 20 attempts
I made to check).  Notice that the file being complained about is
the second in the "default" dependency list.  If I switch the order
then "foo" gets warned about..

I guess I'd expect this never to happen, and I don't want to insert 
sleeps in my makefile.
I reckon that this double target business is a reasonable thing
to want to do.  Removing one of the targets (bar, say) from the
higher target's dependency list is not an acceptable workround
(although that does solve the problem).  If I did that my rebuild
would not be sensitive to someone deleting bar.  Which is bad. 

System/Make info follows:

sli4515:tommyk> uname -a
SunOS sli4515 5.6 Generic_105181-19 sun4u sparc SUNW,Ultra-5_10
sli4515:tommyk> make --version
GNU Make version 3.78.1, by Richard Stallman and Roland McGrath.
Built for sparc-sun-solaris2.6
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
        Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

Report bugs to <[EMAIL PROTECTED]>.

sli4515:tommyk> 


rgds,
tommy


Reply via email to