help-make
[Top][All Lists]
Advanced

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

inappropriate warning on Solaris?


From: David Boyce
Subject: inappropriate warning on Solaris?
Date: Wed, 8 Dec 2010 21:23:37 -0500

Consider the following Makefile:

% cat /tmp/Makefile
.LOW_RESOLUTION_TIME: /tmp/target
/tmp/target: /tmp/prereq
        cp -p $< $@

On Solaris 10 (which saves file timestamps to nanoseconds), using make
3.82, I make and then make again:

% make -f /tmp/Makefile
cp -p /tmp/prereq /tmp/target

% make -f /tmp/Makefile
make: *** Warning: .LOW_RESOLUTION_TIME file `/tmp/target' has a high
resolution time stamp
make: `/tmp/target' is up to date.

The second invocation did nothing (correctly) but issued a warning
which I think is spurious:

% stat /tmp/prereq /tmp/target
  File: `/tmp/prereq'
  Size: 0               Blocks: 0          IO Block: 4096   regular empty file
Device: 48c0002h/76283906d      Inode: 1008469729  Links: 1
Access: (0664/-rw-rw-r--)  Uid: (28010/     dsb)   Gid: (29000/ ccusers)
Access: 2010-12-08 21:06:44.021772357 -0500
Modify: 2010-12-08 21:06:35.001666797 -0500
Change: 2010-12-08 21:06:35.001666797 -0500
  File: `/tmp/target'
  Size: 0               Blocks: 0          IO Block: 4096   regular empty file
Device: 48c0002h/76283906d      Inode: 1026817732  Links: 1
Access: (0664/-rw-rw-r--)  Uid: (28010/     dsb)   Gid: (29000/ ccusers)
Access: 2010-12-08 21:06:35.001666000 -0500
Modify: 2010-12-08 21:06:35.001666000 -0500
Change: 2010-12-08 21:06:44.021803283 -0500

As shown, the target does have a relatively hi-res timestamp but the
prereq is even higher (001666000 vs 001666797). Essentially, Solaris
cp -p chops off just the nanosecond part. It looks to me like make's
algorithm for deciding to give a warning is too simplistic and/or
Linux-centric. Is this a minor bug or am I missing something?

PS Without the .LOW_RESOLUTION_TIME the cp is always done, because of
the truncated timestamp.



reply via email to

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