[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Monitoring make progression
From: |
Paul D. Smith |
Subject: |
Re: Monitoring make progression |
Date: |
Sat, 30 Sep 2006 08:50:43 -0400 |
On Thursday, 28 September, Benjamin Delagoutte (address@hidden) wrote:
> I wonder if there is a way to monitor the progression of a 'make'
> process. I'm currently writing a GUI for a build system, which uses GNU
> 'make'. The build takes a long long time, so I would like 'make' to give
> a feedback to the user : like "60 % done" or "proceeding task #18/120".
> Eventually, I'll use this feedback to move a progress bar in the GUI.
The problem is that not even make knows how many steps will be performed
before the build is complete. Whether or not a step is actually performed
depends on the state of the prerequisites vs. the targets.
Make doesn't even know how many total steps MIGHT be performed; make does
not construct a complete plan of all potential steps before it begins
processing. It simply begins with the first target and follows the
dependency graph, building things that are out of date, until it's done
(there's nothing left to build).
It could be done after 2 steps or 2,000 steps.
I've heard of people using "make -n" first, to have make generate the steps
it plans to perform and counting those, then running the real make. This
seems pretty fragile to me (since "make -n" doesn't run rules, if makefiles
are not well-formed it might not print every rule make runs... and in some
situations it might print rules that make won't really run) and potentially
slow, depending on your project info, but it's as good as anyone has been
able to do so far.
--
-------------------------------------------------------------------------------
Paul D. Smith <address@hidden> Find some GNU make tips at:
http://www.gnu.org http://make.paulandlesley.org
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist