%% "PATTON, BILLY \(SBCSI\)" <[EMAIL PROTECTED]> writes:

  pb> I'm doing a lot of foreach ... eval to create a lot of rules from
  pb> lists.  Is there anyway I can count the number of rules that I
  pb> create?

Not easily.  You could change your eval to add a token to a variable
every time you create a rule:

    __COUNT += a

then use $(words $(__COUNT)).  In the next version of GNU make (3.82)
there will be a $(.TARGETS) special variable, similar to $(.VARIABLES)
for variables.  This will let you count the number of targets total in
the makefile, which is not quite the same thing.

Also you can run "make -p" to print the entire make database; it should
be pretty straightforward to grep out the targets and use "wc -l" or
whatever to count them.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[EMAIL PROTECTED]>          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


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to