• Home
  • Raw
  • Download

Lines Matching full:module

7 # Essentially an include guard; ensures that no module is loaded multiple times.
21 # Runs internal Boost Build unit tests for the specified module. The module's
22 # __test__ rule is executed in its own module to eliminate any inadvertent
23 # effects of testing module dependencies (such as assert) on the module itself.
25 local rule run-module-test ( m )
30 && ( ( --debug in $(argv) ) || ( "--debug-module=$(m)" in $(argv) ) )
39 ECHO "warning:" no __test__ rule defined in module $(m) ;
46 ECHO testing module $(m)... ;
49 local test-module = __test-$(m)__ ;
50 IMPORT $(m) : [ RULENAMES $(m) ] : $(test-module) : [ RULENAMES $(m)
52 IMPORT $(m) : __test__ : $(test-module) : __test__ : LOCALIZE ;
53 module $(test-module)
62 # Return the binding of the given module.
64 rule binding ( module )
66 return $($(module).__binding__) ;
70 # Sets the module-local value of a variable. This is the most reliable way to
71 # set a module-local variable in a different module; it eliminates issues of
74 rule poke ( module-name ? : variables + : value * )
76 module $(<)
83 # Returns the module-local value of a variable. This is the most reliable way to
84 # examine a module-local variable in a different module; it eliminates issues of
87 rule peek ( module-name ? : variables + )
89 module $(<)
96 # Call the given rule locally in the given module. Use this for rules accepting
98 # of the rule's caller (for example, if the rule accesses module globals or is a
101 rule call-in ( module-name ? : rule-name args * : * )
103 module $(module-name)
112 # Given a possibly qualified rule name and arguments, remove any initial module
113 # qualification from the rule and invoke it in that module. If there is no
114 # module qualification, the rule is invoked in the global module. Note that
119 local module-rule = [ MATCH (.*)\\.(.*) : $(qualified-rule-name) ] ;
120 local rule-name = $(module-rule[2]) ;
124 # position for the module name.
125 return [ call-in $(module-rule[1]) : $(rule-name) $(args) : $(2) : $(3) :
131 # Load the indicated module if it is not already loaded.
134 module-name # Name of module to load. Rules will be defined in this
135 # module.
136 : filename ? # (partial) path to file; Defaults to $(module-name).jam.
142 if ! ( $(module-name) in $(.loaded) )
144 filename ?= $(module-name).jam ;
146 # Mark the module loaded so we do not try to load it recursively.
147 .loaded += $(module-name:B) ;
149 # Suppress tests if any module loads are already in progress.
152 # Push this module on the loading stack.
153 .loading += $(module-name) ;
156 .untested += $(module-name) ;
158 # Insert the new module's __name__ and __file__ globals.
159 poke $(module-name) : __name__ : $(module-name) ;
160 poke $(module-name) : __file__ : $(filename) ;
162 module $(module-name)
164 # Add some grist so that the module will have a unique target name.
165 local module-target = $(__file__:G=module@) ;
169 SEARCH on $(module-target) = $(search) ;
170 BINDRULE on $(module-target) = modules.record-binding ;
172 include $(module-target) ;
174 # Allow the module to see its own names with full qualification.
179 if $(module-name) != modules && ! [ binding $(module-name) ]
182 errors.error "Could not find module" $(module-name) in $(search) ;
195 run-module-test $(m) ;
200 else if $(module-name) in $(.loading)
203 errors.error loading \"$(module-name)\"
204 : circular module loading "dependency:"
205 : $(.loading)" ->" $(module-name) ;
211 # loaded module.
213 rule record-binding ( module-target : binding )
238 # Load the indicated module and import rule names into the current module. Any
240 # module. Any members of rename-opt will be taken as the names of the rules in
241 # the caller's module, in place of the names they have in the imported module.
242 # If rules-opt = '*', all rules from the indicated module are imported into the
243 # caller's module. If rename-opt is supplied, it must have the same number of
246 rule import ( module-names + : rules-opt * : rename-opt * )
254 if $(module-names[2]) && ( $(rules-opt) || $(rename-opt) )
263 # Import each specified module
264 for local m in $(module-names)
266 local module-name = $(m:B) ;
267 if ! $(module-name) in $(.loaded)
269 # If the importing module is not already in the BOOST_BUILD_PATH,
295 load $(module-name) : : $(search) ;
298 IMPORT_MODULE $(module-name) : $(caller) ;
305 local all-rules = [ RULENAMES $(module-name) ] ;
314 IMPORT $(module-name) : $(source-names) : $(caller) : $(target-names) ;
320 # Define exported copies in $(target-module) of all rules exported from
321 # $(source-module). Also make them available in the global module with
323 # in $(target-module).
325 rule clone-rules ( source-module target-module )
327 local r = [ RULENAMES $(source-module) ] ;
328 IMPORT $(source-module) : $(r) : $(target-module) : $(r) : LOCALIZE ;
329 EXPORT $(target-module) : $(r) ;
330 IMPORT $(target-module) : $(r) : : $(target-module).$(r) ;
334 # These rules need to be available in all modules to implement module loading
345 module modules.__test__