From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 13 09:20:25 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 24277DB3 for ; Mon, 13 Oct 2014 09:20:25 +0000 (UTC) Received: from ms-10.1blu.de (ms-10.1blu.de [178.254.4.101]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6D0D901 for ; Mon, 13 Oct 2014 09:20:24 +0000 (UTC) Received: from [89.15.237.217] (helo=unixarea.DDR.dd) by ms-10.1blu.de with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1Xdbnh-0006dF-QT for freebsd-hackers@freebsd.org; Mon, 13 Oct 2014 11:20:22 +0200 Received: from unixarea.DDR.dd (localhost [127.0.0.1]) by unixarea.DDR.dd (8.14.9/8.14.3) with ESMTP id s9D9KJ56002772 for ; Mon, 13 Oct 2014 11:20:19 +0200 (CEST) (envelope-from guru@unixarea.de) Received: (from guru@localhost) by unixarea.DDR.dd (8.14.9/8.14.3/Submit) id s9D9KIsV002771 for freebsd-hackers@freebsd.org; Mon, 13 Oct 2014 11:20:18 +0200 (CEST) (envelope-from guru@unixarea.de) X-Authentication-Warning: unixarea.DDR.dd: guru set sender to guru@unixarea.de using -f Date: Mon, 13 Oct 2014 11:20:18 +0200 From: Matthias Apitz To: freebsd-hackers@freebsd.org Subject: gmake && file time precision of 1 second Message-ID: <20141013092018.GA2737@unixarea.DDR.dd> Reply-To: Matthias Apitz Mail-Followup-To: Matthias Apitz , freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Operating-System: FreeBSD 11.0-CURRENT r269739 (i386) User-Agent: Mutt/1.5.23 (2014-03-12) X-Con-Id: 51246 X-Con-U: 0-guru X-Originating-IP: 89.15.237.217 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 09:20:25 -0000 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. Thx matthias -- Matthias Apitz | /"\ ASCII Ribbon Campaign: E-mail: guru@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