gmake && file time precision of 1 second

Tristan Verniquet tris_vern at hotmail.com
Mon Oct 13 12:07:20 UTC 2014


We have this problem too using recursive make and I am interested in 
what other solutions there are. Currently we sleep until the start of the next 
second using a custom binary, but it does slow down the 
build.

Another thing I've tried though haven't put much thought into is touching the lib file -1 second after each ar command.

Tristan

> Date: Mon, 13 Oct 2014 11:20:18 +0200
> From: guru at unixarea.de
> To: freebsd-hackers at freebsd.org
> Subject: gmake && file time precision of 1 second
> 
> 
> 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 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
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
 		 	   		  


More information about the freebsd-hackers mailing list