gmake && file time precision of 1 second

Matthias Apitz guru at unixarea.de
Tue Oct 14 07:10:57 UTC 2014


El día Monday, October 13, 2014 a las 02:59:03PM +0200, Stefan Esser escribió:

> > after moving to a faster server it turned out that gmake sometimes forget
> > to ar the *.o into the lib; I investigated it and it turned out that the
> > *.o files have the same modification time (in seconds) as the target
> > lib.a (which was produced/updated in the last directory worked on) and
> > gmake thinks that the lib.a is uptodate.
> > 
> > Any idea how to address this in the Makefiles?
> > 
> > Well I could place (and it works) a 'sleep 1' into the loop, but I think
> > that there is some better way.
> 
> Could this be a solutionn for you:
> 
> $ sysctl -d vfs.timestamp_precision
> vfs.timestamp_precision: File timestamp precision (0: seconds, 1: sec +
> ns accurate to 1/HZ, 2: sec + ns truncated to ms, 3+: sec + ns (max.
> precision))
> 
> Beware: This is a global variable, higher resolution timestamps are
> not supported on all filesystems, and not all programs check for the
> sub-second part of the timestamp value ...

Thanks. I was hoping that there is a Makefile solution in the sense that
if objs and target lib have the same age (i.e. the same second of age), that
gmake assumes that the obj is newer.

We will re-think our Makefiles, write into different lib.a and merge them
in a final step by unpacking the libs with ar again.

Thx

	matthias

-- 
Matthias Apitz               |  /"\   ASCII Ribbon Campaign:
E-mail: guru at unixarea.de     |  \ /   - No HTML/RTF in E-mail
WWW: http://www.unixarea.de/ |   X    - No proprietary attachments
phone: +49-170-4527211       |  / \   - Respect for open standards
                             | en.wikipedia.org/wiki/ASCII_Ribbon_Campaign


More information about the freebsd-hackers mailing list