help-make
[Top][All Lists]
Advanced

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

Re: GNU Make 4.2 Query


From: Paul Smith
Subject: Re: GNU Make 4.2 Query
Date: Fri, 31 May 2019 13:15:25 -0400

I'm adding back the mailing list.  Please always keep it on the CC list
at least (or just reply to the list directly: I am subscribed).

On Fri, 2019-05-31 at 21:16 +0530, nikhil jain wrote:
> Yes sure. Thanks for your response. 
> 
> I see there is an option of make -n which lists the rules to build.
> As you were telling, It will need a huge change in the GMAKE code. I
> was actually surprised that there is no way to know how many rules
> are left. I was trying to build a server which would let the user
> know about the % of their job completion. I feel this is the basic
> feature from the end user point of view. I have actually implemented
> remote-stub.c which comes as a stub in the MAKE code. If there is a
> way to find how many rules are left, that would be really great.
> Cannot we have a single command which just runs -n first and then
> starts building ? It can save the total number of rules in a global
> variable which I can access from remote_setup() which is called just
> once before the make starts to execute job remotely.

I'm not interested in implementing this but if someone else wanted to
(along with appropriate copyright assignment, regression tests, etc.)
and the implementation was reasonable, I'd consider it.

Otherwise, it will have to be done through some external scripting and
the results provided to make by, for example, setting a variable on the
command line:

  make NUMRECIPES=$(make -n | count-recipes.sh)

You can query this variable in your code.  Writing count-recipes.sh
probably has to rely on a knowledge of the recipes being run, if you
want to count the number of targets being built.

Note that make -n might sometimes actually run some rules: it will run
any rule which is marked as a recursive make.  It will also run any
rules needed to update included makefiles.  So, that has to be taken
into consideration.




reply via email to

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