kingkong
kingkong

Reputation: 263

Make percentage completion

I am wondering if at all it is possible to generate a completion percentage for a given Makefile execution? I have a Makefile which runs sum tests, the output is hidden from the user for UI purposes, however, I am wondering if I can perhaps give a percentage indication of the execution of that Makefile.

NO code as, I have no idea how to even pursue this and am just looking for pointers.

Also, even if you did get a percentage figure from make, how could we update it in the shell?

Thanks

Upvotes: 1

Views: 325

Answers (1)

MadScientist
MadScientist

Reputation: 100926

There's no way for make itself to give this information, because make doesn't know. Make does NOT work by first computing all the targets that will need to be rebuilt, then building them. Rather, make works by walking the dependency graph one node at a time, until finally there's no work left to do. Since make doesn't know how many targets will be built until it's done, it can't provide a percentage complete value.

The only way for you to do this would be if YOU compute the a percentage value, by virtue of knowing how many targets there are and which target is currently running. You'd have to write this information into your recipes.

Upvotes: 4

Related Questions