From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 13 13:06:47 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09037C2E; Mon, 13 Oct 2014 13:06:47 +0000 (UTC) Received: from mailout12.t-online.de (mailout12.t-online.de [194.25.134.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout00.t-online.de", Issuer "TeleSec ServerPass DE-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BCC75FBC; Mon, 13 Oct 2014 13:06:46 +0000 (UTC) Received: from fwd35.aul.t-online.de (fwd35.aul.t-online.de [172.20.27.145]) by mailout12.t-online.de (Postfix) with SMTP id 6063E14E986; Mon, 13 Oct 2014 14:59:07 +0200 (CEST) Received: from [192.168.119.10] (G5NOUMZ6Yh7tAht2WeGhe3XS-FPk52S3gG4w8kl51CGSvv8q3+Fal0r3lHPrLZxZpt@[84.154.118.168]) by fwd35.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-SHA encrypted) esmtp id 1XdfDO-38hAw40; Mon, 13 Oct 2014 14:59:06 +0200 Message-ID: <543BCC97.7080608@freebsd.org> Date: Mon, 13 Oct 2014 14:59:03 +0200 From: Stefan Esser User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: Matthias Apitz Subject: Re: gmake && file time precision of 1 second References: <20141013092018.GA2737@unixarea.DDR.dd> In-Reply-To: <20141013092018.GA2737@unixarea.DDR.dd> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-ID: G5NOUMZ6Yh7tAht2WeGhe3XS-FPk52S3gG4w8kl51CGSvv8q3+Fal0r3lHPrLZxZpt X-TOI-MSGID: e5570e22-252f-4210-a6d8-0a3ec0bddc00 Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2014 13:06:47 -0000 Am 13.10.2014 um 11:20 schrieb Matthias Apitz: > > Hello, > > I have a large project where a shell script fires up > gmake runs in subdirs as: > > for dir in src norm print ....; do > cd $dir > gmake > cd .. > done > > in each subdir *.c are compiled to *.o and the resulting *.o are ar'ed > into all the same lib.a; based on normal Makefile rules like: > > SRCS = f1.c f2.c > OBJS = $(SRCS:.c=.o) > > .c.o: > $(CC) -c ... $*.c > > lib.a:: $(OBJS) > $(AR) $@ $(OBJS) > > > 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 ... Regards, STefan