[Top][All Lists]

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

Long builds and dependency checking

From: Bhatt, Milan C
Subject: Long builds and dependency checking
Date: Tue, 24 Jul 2001 12:12:50 -0700

One problem I've run into using gmake is that if it takes a long time to build a target file and the prerequisites change in between the build time, gmake will not recreate the target because it is more recent than its prerequisites.  Has anyone found a solution for this problem?
The only current solution is have is the following:
B := tmp/
target1 : $(B)a.txt
    @ls > target1
$(B)a.txt : a.txt
    @touch $(B)a.txt
In this solution the target is dependant on an intermediate file and its prerequisite is the actual prerequisite we want.  Therefore whenever the target is being recreated, the intermediate file  $(B)a.txt will have the time stamp of when the build began.  Whenever the actual source file a.txt changes, it will make $(B)a.txt out of date and forcing the recompilation of the target 'target1'
This solution is pretty messy in that you've got to create these intermediate files for every single one of your prerequisites.
If anyone knows of something better, please me know.

reply via email to

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