[Top][All Lists]

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

gnu make timing problem ?

From: Eldar Firing
Subject: gnu make timing problem ?
Date: Fri, 2 Feb 2001 07:51:31 +0100

We have been using gnu make for several years in our development
(C++ code, IRIX / Linux Mandrake platforms).
Current version is 3.79.
As we are using faster and faster compiling machines,  we have discovered
what seems to
be timing problems with gnu make. Problem is as follows : 
We have a large number of directories in our source tree, and some
directories contains 
only a single C++ file / class. The directory structure is something like
this : 

---- lib/libcommon.a
----src/common/dir1/file.cc, file2.cc ..... fileN.cc, Makefile
----src/common/dir2/onefile.cc , Makefile


All objects file under 'common' directory are put into one library :
So, after compiling dir1, all objects file are put into 'libcommon.a' which
then get a new date.
Then gnu make traverses into next dir 'dir2' and compiles 'onfile.cc'.
However, sometimes the objectfile 'onefile.o'
is NOT put into the 'libcommon.a' , probably because 'libcommon.a' and
'onefile.o' has the same date in seconds.
Is one second the finest resolution that gnu make uses when checking
dependencies ? 
It a bug, or is this the way gnu make works ? . 
As a workaround, we have put a statement like 'DUMMY := $(shell sleep 1)'
into the local Makefile.
Each time we use a faster machine, new directories has this problem, and it
might happen after several successful compilations.
We could of course put the sleep into the common 'default.mk' which is
included by all Makefile's, but that would 
increase the total compile time of the source tree and it's not something we
want to do.
Comments ? 


Eldar Firing - Software Development Engineer
Navia Aviation as - Division NOVA , http://www.naviaav.com
P.O. box 1080, Bromsveien 17, 3194 Horten  - NORWAY
Phone : +47 23123733 , Fax : +47 23123710
E-mail: address@hidden

reply via email to

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