1 # Copyright 2002, 2005 Dave Abrahams
2 # Copyright 2002, 2003, 2006 Rene Rivera
3 # Copyright 2003 Vladimir Prus
4 # Distributed under the Boost Software License, Version 1.0.
5 # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
7 # Documentation system, handles --help requests.
8 # It defines rules that attach documentation to modules, rules, and variables.
9 # Collects and generates documentation for the various parts of the build
10 # system. The documentation is collected from comments integrated into the code.
21 # The type of output to generate.
22 # "console" is formated text echoed to the console (the default);
23 # "text" is formated text appended to the output file;
24 # "html" is HTML output to the file.
26 help-output = console ;
29 # The file to output documentation to when generating "text" or "html" help.
30 # This is without extension as the extension is determined by the type of
33 help-output-file = help ;
35 # Whether to include local rules in help output.
37 .option.show-locals ?= ;
39 # When showing documentation for a module, whether to also generate
40 # automatically the detailed docs for each item in the module.
44 # Generate debug output as the help is generated and modules are parsed.
48 # These are all the options available for enabling or disabling to control the
49 # help system in various ways. Options can be enabled or disabled with
50 # '--help-enable-<option>', and '--help-disable-<option>' respectively.
52 .option-description = Help Options ;
54 # Enable or disable a documentation option.
56 local rule set-option (
57 option # The option name.
58 : value ? # Enabled (non-empty), or disabled (empty)
61 .option.$(option) = $(value) ;
65 # Set the type of output.
67 local rule set-output ( type )
69 help-output = $(type) ;
73 # Set the output to a file.
75 local rule set-output-file ( file )
77 help-output-file = $(file) ;
81 # Extracts the brief comment from a complete comment. The brief comment is the
84 local rule brief-comment (
85 docs * # The comment documentation.
88 local d = $(docs:J=" ") ;
89 local p = [ MATCH ".*([.])$" : $(d) ] ;
90 if ! $(p) { d = $(d)"." ; }
92 local m = [ MATCH "^([^.]+[.])(.*)" : $(d) ] ;
93 local brief = $(m[1]) ;
94 while $(m[2]) && [ MATCH "^([^ ])" : $(m[2]) ]
96 m = [ MATCH "^([^.]+[.])(.*)" : $(m[2]) ] ;
99 return $(brief:J="") ;
103 # Specifies the documentation for the current module.
105 local rule set-module-doc (
106 module-name ? # The name of the module to document.
107 : docs * # The documentation for the module.
112 $(module-name).brief = [ brief-comment $(docs) ] ;
113 $(module-name).docs = $(docs) ;
115 if ! $(module-name) in $(documented-modules)
117 documented-modules += $(module-name) ;
122 # Specifies the documentation for the current module.
124 local rule set-module-copyright (
125 module-name ? # The name of the module to document.
126 : copyright * # The copyright for the module.
131 $(module-name).copy-brief = [ brief-comment $(copyright) ] ;
132 $(module-name).copy-docs = $(docs) ;
134 if ! $(module-name) in $(documented-modules)
136 documented-modules += $(module-name) ;
141 # Specifies the documentation for a rule in the current module. If called in the
142 # global module, this documents a global rule.
144 local rule set-rule-doc (
145 name # The name of the rule.
146 module-name ? # The name of the module to document.
147 is-local ? # Whether the rule is local to the module.
148 : docs * # The documentation for the rule.
153 $(module-name).$(name).brief = [ brief-comment $(docs) ] ;
154 $(module-name).$(name).docs = $(docs) ;
155 $(module-name).$(name).is-local = $(is-local) ;
157 if ! $(name) in $($(module-name).rules)
159 $(module-name).rules += $(name) ;
164 # Specify a class, will turn a rule into a class.
166 local rule set-class-doc (
167 name # The name of the class.
168 module-name ? # The name of the module to document.
169 : super-name ? # The super class name.
174 $(module-name).$(name).is-class = true ;
175 $(module-name).$(name).super-name = $(super-name) ;
176 $(module-name).$(name).class-rules =
177 [ MATCH "^($(name)[.].*)" : $($(module-name).rules) ] ;
178 $(module-name).$($(module-name).$(name).class-rules).is-class-rule = true ;
180 $(module-name).classes += $(name) ;
181 $(module-name).class-rules += $($(module-name).$(name).class-rules) ;
182 $(module-name).rules =
183 [ set.difference $($(module-name).rules) :
184 $(name) $($(module-name).$(name).class-rules) ] ;
188 # Set the argument call signature of a rule.
190 local rule set-rule-arguments-signature (
191 name # The name of the rule.
192 module-name ? # The name of the module to document.
193 : signature * # The arguments signature.
198 $(module-name).$(name).signature = $(signature) ;
202 # Specifies the documentation for an argument of a rule.
204 local rule set-argument-doc (
205 name # The name of the argument.
206 qualifier # Argument syntax qualifier, "*", "+", etc.
207 rule-name # The name of the rule.
208 module-name ? # THe optional name of the module.
209 : docs * # The documentation.
214 $(module-name).$(rule-name).args.$(name).qualifier = $(qualifier) ;
215 $(module-name).$(rule-name).args.$(name).docs = $(docs) ;
217 if ! $(name) in $($(module-name).$(rule-name).args)
219 $(module-name).$(rule-name).args += $(name) ;
224 # Specifies the documentation for a variable in the current module. If called in
225 # the global module, the global variable is documented.
227 local rule set-variable-doc (
228 name # The name of the variable.
229 default # The default value.
230 initial # The initial value.
231 module-name ? # The name of the module to document.
232 : docs * # The documentation for the variable.
237 $(module-name).$(name).brief = [ brief-comment $(docs) ] ;
238 $(module-name).$(name).default = $(default) ;
239 $(module-name).$(name).initial = $(initial) ;
240 $(module-name).$(name).docs = $(docs) ;
242 if ! $(name) in $($(module-name).variables)
244 $(module-name).variables += $(name) ;
249 # Generates a general description of the documentation and help system.
251 local rule print-help-top ( )
253 print.section "General command line usage" ;
255 print.text " b2 [options] [properties] [targets]
257 Options, properties and targets can be specified in any order.
260 print.section "Important Options" ;
263 print.list-item "--clean Remove targets instead of building" ;
264 print.list-item "-a Rebuild everything" ;
265 print.list-item "-n Don't execute the commands, only print them" ;
266 print.list-item "-d+2 Show commands as they are executed" ;
267 print.list-item "-d0 Suppress all informational messages" ;
268 print.list-item "-q Stop at first error" ;
269 print.list-item "--reconfigure Rerun all configuration checks" ;
270 print.list-item "--debug-configuration Diagnose configuration" ;
271 print.list-item "--debug-building Report which targets are built with what properties" ;
272 print.list-item "--debug-generator Diagnose generator search/execution" ;
275 print.section "Further Help"
276 The following options can be used to obtain additional documentation.
280 print.list-item "--help-options Print more obscure command line options." ;
281 print.list-item "--help-internal Boost.Build implementation details." ;
282 print.list-item "--help-doc-options Implementation details doc formatting." ;
287 # Generate Jam/Boost.Jam command usage information.
289 local rule print-help-usage ( )
291 print.section "Boost.Build Usage"
292 "b2 [ options... ] targets..."
296 Build all targets, even if they are current. ;
298 Read '"x"' as the Jamfile for building instead of searching for the
299 Boost.Build system. ;
301 Run up to '"x"' commands concurrently. ;
303 Do not execute build commands. Instead print out the commands as they
304 would be executed if building. ;
306 Output the used build commands to file '"x"'. ;
308 Quit as soon as a build failure is encountered. Without this option
309 Boost.Jam will continue building as many targets as it can. ;
310 print.list-item -sx=y;
311 Sets a Jam variable '"x"' to the value '"y"', overriding any value that
312 variable would have from the environment. ;
314 Rebuild the target '"x"', even if it is up-to-date. ;
316 Display the version of b2. ;
318 Any option not explicitly handled by Boost.Build remains available to
319 build scripts using the '"ARGV"' variable. ;
320 print.list-item --abbreviate-paths;
321 Use abbreviated paths for targets. ;
322 print.list-item --hash;
323 Shorten target paths by using an MD5 hash. ;
325 Enables output of diagnostic messages. The debug level '"n"' and all
326 below it are enabled by this option. ;
327 print.list-item -d+n;
328 Enables output of diagnostic messages. Only the output for debug level
331 print.section "Debug Levels"
332 Each debug level shows a different set of information. Usually with
333 higher levels producing more verbose information. The following levels
337 Turn off all diagnostic output. Only errors are reported. ;
339 Show the actions taken for building targets, as they are executed. ;
341 Show "quiet" actions and display all action text, as they are executed. ;
343 Show dependency analysis, and target/source timestamps/paths. ;
345 Show arguments of shell invocations. ;
347 Show rule invocations and variable expansions. ;
349 Show directory/header file/archive scans, and attempts at binding to targets. ;
351 Show variable settings. ;
353 Show variable fetches, variable expansions, and evaluation of '"if"' expressions. ;
355 Show variable manipulation, scanner tokens, and memory usage. ;
357 Show execution times for rules. ;
359 Show parsing progress of Jamfiles. ;
361 Show graph for target dependencies. ;
363 Show changes in target status (fate). ;
367 # Generates description of options controlling the help system. This
368 # automatically reads the options as all variables in the module given
369 # with the name `module-name` of the form ".option.*".
371 local rule print-help-options (
375 local options-to-list = [ MATCH ^[.]option[.](.*) : $($(module-name).variables) ] ;
376 if $(options-to-list)
378 local option-title = $($(module-name)..option-description.initial) ;
379 if ! $(option-title) || $(option-title) = "(empty)"
381 option-title = "$(module-name) Options" ;
383 local option-description = $(option-title)
384 $($(module-name)..option-description.docs) ;
385 print.section $(option-description) ;
387 for local option in [ sequence.insertion-sort $(options-to-list) ]
389 local def = disabled ;
390 if $($(module-name)..option.$(option).default) != "(empty)"
392 def = $($(module-name)..option.$(option).default) ;
394 print.list-item $(option): $($(module-name)..option.$(option).docs)
402 # Generate brief documentation for all the known items in the section for a
403 # module. Possible sections are: "rules", and "variables".
405 local rule print-help-module-section (
406 module # The module name.
407 section # rules or variables.
408 : section-head # The title of the section.
409 section-description * # The detailed description of the section.
412 if $($(module).$(section))
414 print.section $(section-head) $(section-description) ;
416 for local item in [ sequence.insertion-sort $($(module).$(section)) ]
419 if ! $($(module).$(item).is-local)
423 if $(.option.show-locals)
429 print.list-item $(item): $($(module).$(item).brief) ;
437 # Generate documentation for all possible modules. We attempt to list all known
438 # modules together with a brief description of each.
440 local rule print-help-all (
441 ignored # Usually the module name, but is ignored here.
444 print.section "Modules"
445 "These are all the known modules. Use --help <module> to get more"
446 "detailed information."
448 if $(documented-modules)
451 for local module-name in [ sequence.insertion-sort $(documented-modules) ]
453 # The brief docs for each module.
454 print.list-item $(module-name): $($(module-name).brief) ;
458 # The documentation for each module when details are requested.
459 if $(documented-modules) && $(.option.detailed)
461 for local module-name in [ sequence.insertion-sort $(documented-modules) ]
463 # The brief docs for each module.
464 print-help-module $(module-name) ;
470 # Generate documentation for a module. Basic information about the module is
473 local rule print-help-module (
474 module-name # The module to generate docs for.
478 print.section "Module '$(module-name)'" $($(module-name).docs) ;
480 # Print out the documented classes.
481 print-help-module-section $(module-name) classes : "Module '$(module-name)' classes"
482 Use --help $(module-name).<class-name> to get more information. ;
484 # Print out the documented rules.
485 print-help-module-section $(module-name) rules : "Module '$(module-name)' rules"
486 Use --help $(module-name).<rule-name> to get more information. ;
488 # Print out the documented variables.
489 print-help-module-section $(module-name) variables : "Module '$(module-name)' variables"
490 Use --help $(module-name).<variable-name> to get more information. ;
492 # Print out all the same information but indetailed form.
493 if $(.option.detailed)
495 print-help-classes $(module-name) ;
496 print-help-rules $(module-name) ;
497 print-help-variables $(module-name) ;
502 # Generate documentation for a set of rules in a module.
504 local rule print-help-rules (
505 module-name # Module of the rules.
506 : name * # Optional list of rules to describe.
509 name ?= $($(module-name).rules) ;
510 if [ set.intersection $(name) : $($(module-name).rules) $($(module-name).class-rules) ]
512 # Print out the given rules.
513 for local rule-name in [ sequence.insertion-sort $(name) ]
515 if $(.option.show-locals) || ! $($(module-name).$(rule-name).is-local)
517 local signature = $($(module-name).$(rule-name).signature:J=" ") ;
519 print.section "Rule '$(module-name).$(rule-name) ( $(signature) )'"
520 $($(module-name).$(rule-name).docs) ;
521 if $($(module-name).$(rule-name).args)
524 for local arg-name in $($(module-name).$(rule-name).args)
526 print.list-item $(arg-name): $($(module-name).$(rule-name).args.$(arg-name).docs) ;
536 # Generate documentation for a set of classes in a module.
538 local rule print-help-classes (
539 module-name # Module of the classes.
540 : name * # Optional list of classes to describe.
543 name ?= $($(module-name).classes) ;
544 if [ set.intersection $(name) : $($(module-name).classes) ]
546 # Print out the given classes.
547 for local class-name in [ sequence.insertion-sort $(name) ]
549 if $(.option.show-locals) || ! $($(module-name).$(class-name).is-local)
551 local signature = $($(module-name).$(class-name).signature:J=" ") ;
553 print.section "Class '$(module-name).$(class-name) ( $(signature) )'"
554 $($(module-name).$(class-name).docs)
555 "Inherits from '"$($(module-name).$(class-name).super-name)"'." ;
556 if $($(module-name).$(class-name).args)
559 for local arg-name in $($(module-name).$(class-name).args)
561 print.list-item $(arg-name): $($(module-name).$(class-name).args.$(arg-name).docs) ;
567 # Print out the documented rules of the class.
568 print-help-module-section $(module-name) $(class-name).class-rules : "Class '$(module-name).$(class-name)' rules"
569 Use --help $(module-name).<rule-name> to get more information. ;
571 # Print out all the rules if details are requested.
572 if $(.option.detailed)
574 print-help-rules $(module-name) : $($(module-name).$(class-name).class-rules) ;
581 # Generate documentation for a set of variables in a module.
583 local rule print-help-variables (
584 module-name ? # Module of the variables.
585 : name * # Optional list of variables to describe.
588 name ?= $($(module-name).variables) ;
589 if [ set.intersection $(name) : $($(module-name).variables) ]
591 # Print out the given variables.
592 for local variable-name in [ sequence.insertion-sort $(name) ]
594 print.section "Variable '$(module-name).$(variable-name)'" $($(module-name).$(variable-name).docs) ;
595 if $($(module-name).$(variable-name).default) ||
596 $($(module-name).$(variable-name).initial)
599 if $($(module-name).$(variable-name).default)
601 print.list-item "default value:" '$($(module-name).$(variable-name).default:J=" ")' ;
603 if $($(module-name).$(variable-name).initial)
605 print.list-item "initial value:" '$($(module-name).$(variable-name).initial:J=" ")' ;
614 # Generate documentation for a project.
616 local rule print-help-project (
618 : jamfile * # The project Jamfile.
621 if $(jamfile<$(jamfile)>.docs)
624 print.section "Project-specific help"
625 Project has jamfile at $(jamfile) ;
627 print.lines $(jamfile<$(jamfile)>.docs) "" ;
632 # Generate documentation for a config file.
634 local rule print-help-config (
636 : type # The type of configuration file user or site.
637 config-file # The configuration Jamfile.
640 if $(jamfile<$(config-file)>.docs)
643 print.section "Configuration help"
644 Configuration file at $(config-file) ;
646 print.lines $(jamfile<$(config-file)>.docs) "" ;
653 # Extract the text from a block of comments.
655 local rule extract-comment (
656 var # The name of the variable to extract from.
660 local line = $($(var)[1]) ;
661 local l = [ MATCH "^[$(ws)]*(#)(.*)$" : $(line) ] ;
662 while $(l[1]) && $($(var))
664 if $(l[2]) { comment += [ MATCH "^[$(ws)]?(.*)$" : $(l[2]) ] ; }
665 else { comment += "" ; }
666 $(var) = $($(var)[2-]) ;
667 line = $($(var)[1]) ;
668 l = [ MATCH "^[$(ws)]*(#)(.*)$" : $(line) ] ;
674 # Extract s single line of Jam syntax, ignoring any comments.
676 local rule extract-syntax (
677 var # The name of the variable to extract from.
681 local line = $($(var)[1]) ;
682 while ! $(syntax) && ! [ MATCH "^[$(ws)]*(#)" : $(line) ] && $($(var))
684 local m = [ MATCH "^[$(ws)]*(.*)$" : $(line) ] ;
689 $(var) = $($(var)[2-]) ;
690 line = $($(var)[1]) ;
696 # Extract the next token, this is either a single Jam construct or a comment as
699 local rule extract-token (
700 var # The name of the variable to extract from.
706 parts = [ MATCH "^[$(ws)]*([^$(ws)]+)[$(ws)]*(.*)" : $($(var)[1]) ] ;
709 $(var) = $($(var)[2-]) ;
713 if [ MATCH "^(#)" : $(parts[1]) ]
715 token = $(parts:J=" ") ;
716 $(var) = $($(var)[2-]) ;
720 token = $(parts[1]) ;
721 $(var) = $(parts[2-]:J=" ") $($(var)[2-]) ;
727 # Scan for a rule declaration as the next item in the variable.
729 local rule scan-rule (
730 syntax ? # The first part of the text which contains the rule declaration.
731 : var # The name of the variable to extract from.
735 [ MATCH "^[$(ws)]*(rule|local[$(ws)]*rule)[$(ws)]+([^$(ws)]+)[$(ws)]*(.*)" : $(syntax:J=" ") ] ;
738 # Mark as doc for rule.
739 local rule-name = $(rule-parts[2]) ;
742 rule-name = $(scope-name).$(rule-name) ;
744 local is-local = [ MATCH "^(local).*" : $(rule-parts[1]) ] ;
747 set-rule-doc $(rule-name) $(module-name) $(is-local) : $(comment-block) ;
749 # Parse args of rule.
750 $(var) = $(rule-parts[3-]) $($(var)) ;
751 set-rule-arguments-signature $(rule-name) $(module-name) : [ scan-rule-arguments $(var) ] ;
752 # Scan within this rules scope.
753 local scope-level = [ extract-token $(var) ] ;
754 local scope-name = $(rule-name) ;
755 while $(scope-level) && $($(var))
757 local comment-block = [ extract-comment $(var) ] ;
758 local syntax-block = [ extract-syntax $(var) ] ;
759 if [ scan-rule $(syntax-block) : $(var) ]
762 else if [ MATCH "^(\\{)" : $(syntax-block) ]
766 else if [ MATCH "^[^\\}]*([\\}])[$(ws)]*$" : $(syntax-block) ]
768 scope-level = $(scope-level[2-]) ;
777 # Scan the arguments of a rule.
779 local rule scan-rule-arguments (
780 var # The name of the variable to extract from.
784 local token = [ extract-token $(var) ] ;
785 while $(token) != "(" && $(token) != "{"
787 token = [ extract-token $(var) ] ;
791 token = [ extract-token $(var) ] ;
793 local arg-signature = ;
794 while $(token) != ")" && $(token) != "{"
797 local arg-qualifier = " " ;
801 arg-signature += $(token) ;
802 token = [ extract-token $(var) ] ;
804 arg-name = $(token) ;
805 arg-signature += $(token) ;
806 token = [ extract-token $(var) ] ;
807 if [ MATCH "^([\\*\\+\\?])" : $(token) ]
809 arg-qualifier = $(token) ;
810 arg-signature += $(token) ;
811 token = [ extract-token $(var) ] ;
815 arg-signature += $(token) ;
816 token = [ extract-token $(var) ] ;
818 if [ MATCH "^(#)" : $(token) ]
820 $(var) = $(token) $($(var)) ;
821 arg-doc = [ extract-comment $(var) ] ;
822 token = [ extract-token $(var) ] ;
824 set-argument-doc $(arg-name) $(arg-qualifier) $(rule-name) $(module-name) : $(arg-doc) ;
826 while $(token) != "{"
828 token = [ extract-token $(var) ] ;
830 $(var) = "{" $($(var)) ;
831 arg-signature ?= "" ;
832 return $(arg-signature) ;
836 # Scan for a variable declaration.
838 local rule scan-variable (
839 syntax ? # The first part of the text which contains the variable declaration.
840 : var # The name of the variable to extract from.
843 # [1] = name, [2] = value(s)
845 [ MATCH "^[$(ws)]*([^$(ws)]+)[$(ws)]+([\\?\\=]*)[$(ws)]+([^\\;]*)\\;" : $(syntax) ] ;
848 local value = [ MATCH "^(.*)[ ]$" : $(var-parts[3-]:J=" ") ] ;
849 local default-value = "" ;
850 local initial-valie = "" ;
851 if $(var-parts[2]) = "?="
853 default-value = $(value) ;
854 default-value ?= "(empty)" ;
858 initial-value = $(value) ;
859 initial-value ?= "(empty)" ;
863 set-variable-doc $(var-parts[1]) $(default-value) $(initial-value) $(module-name) : $(comment-block) ;
870 # Scan a class declaration.
872 local rule scan-class (
873 syntax ? # The syntax text for the class declaration.
876 # [1] = class?, [2] = name, [3] = superclass
878 [ MATCH "^[$(ws)]*([^$(ws)]+)[$(ws)]+([^$(ws)]+)[$(ws)]+:*[$(ws)]*([^$(ws);]*)" : $(syntax) ] ;
879 if $(class-parts[1]) = "class" || $(class-parts[1]) = "class.class"
881 set-class-doc $(class-parts[2]) $(module-name) : $(class-parts[3]) ;
886 # Scan a module file for documentation comments. This also invokes any actions
887 # assigned to the module. The actions are the rules that do the actual output of
888 # the documentation. This rule is invoked as the header scan rule for the module
892 target # The module file.
893 : text * # The text in the file, one item per line.
894 : action * # Rule to call to output docs for the module.
897 if $(.option.debug) { ECHO "HELP:" scanning module target '$(target)' ; }
898 local module-name = $(target:B) ;
899 local module-documented = ;
900 local comment-block = ;
901 local syntax-block = ;
902 # This is a hack because we can not get the line of a file if it happens to
903 # not have a new-line termination.
907 comment-block = [ extract-comment text ] ;
908 syntax-block = [ extract-syntax text ] ;
911 ECHO "HELP:" comment block; '$(comment-block)' ;
912 ECHO "HELP:" syntax block; '$(syntax-block)' ;
914 if [ scan-rule $(syntax-block) : text ] { }
915 else if [ scan-variable $(syntax-block) : text ] { }
916 else if [ scan-class $(syntax-block) ] { }
917 else if [ MATCH .*([cC]opyright).* : $(comment-block:J=" ") ]
919 # mark as the copy for the module.
920 set-module-copyright $(module-name) : $(comment-block) ;
922 else if $(action[1]) in "print-help-project" "print-help-config"
923 && ! $(jamfile<$(target)>.docs)
925 # special module docs for the project jamfile.
926 jamfile<$(target)>.docs = $(comment-block) ;
928 else if ! $(module-documented)
930 # document the module.
931 set-module-doc $(module-name) : $(comment-block) ;
932 module-documented = true ;
937 $(action[1]) $(module-name) : $(action[2-]) ;
942 # Import scan-module to global scope, so that it is available during header
945 IMPORT $(__name__) : scan-module : : doc.scan-module ;
948 # Read in a file using the SHELL builtin and return the individual lines as
949 # would be done for header scanning.
951 local rule read-file (
952 file # The file to read in.
955 file = [ path.native [ path.root [ path.make $(file) ] [ path.pwd ] ] ] ;
956 if ! $(.file<$(file)>.lines)
959 switch [ modules.peek : OS ]
962 content = [ SHELL "TYPE \"$(file)\"" ] ;
965 content = [ SHELL "cat \"$(file)\"" ] ;
970 local << = "([^$(nl)]*)[$(nl)](.*)" ;
971 local line+ = [ MATCH "$(<<)" : "$(content)" ] ;
974 lines += $(line+[1]) ;
975 line+ = [ MATCH "$(<<)" : "$(line+[2])" ] ;
977 .file<$(file)>.lines = $(lines) ;
979 return $(.file<$(file)>.lines) ;
983 # Add a scan action to perform to generate the help documentation. The action
984 # rule is passed the name of the module as the first argument. The second
985 # argument(s) are optional and passed directly as specified here.
988 modules + # The modules to scan and perform the action on.
989 : action * # The action rule, plus the secondary arguments to pass to the action rule.
992 if $(help-output) = text
994 print.output $(help-output-file).txt plain ;
995 ALWAYS $(help-output-file).txt ;
996 DEPENDS all : $(help-output-file).txt ;
998 if $(help-output) = html
1000 print.output $(help-output-file).html html ;
1001 ALWAYS $(help-output-file).html ;
1002 DEPENDS all : $(help-output-file).html ;
1004 for local module-file in $(modules[1--2])
1006 scan-module $(module-file) : [ read-file $(module-file) ] ;
1008 scan-module $(modules[-1]) : [ read-file $(modules[-1]) ] : $(action) ;