1 # Copyright David Abrahams 2004. Distributed under the Boost
2 # Software License, Version 1.0. (See accompanying
3 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 # This module's job is to automatically import all the type
6 # registration modules in its directory.
7 import type os path modules ;
9 # Register the given type on the specified OSes, or on remaining OSes
10 # if os is not specified. This rule is injected into each of the type
11 # modules for the sake of convenience.
12 local rule type ( type : suffixes * : base-type ? : os * )
14 if ! [ type.registered $(type) ]
16 if ( ! $(os) ) || [ os.name ] in $(os)
18 type.register $(type) : $(suffixes) : $(base-type) ;
23 .this-module's-file = [ modules.binding $(__name__) ] ;
24 .this-module's-dir = [ path.parent $(.this-module's-file) ] ;
25 .sibling-jamfiles = [ path.glob $(.this-module's-dir) : *.jam ] ;
26 .sibling-modules = [ MATCH ^(.*)\.jam$ : $(.sibling-jamfiles) ] ;
28 # A loop over all modules in this directory
29 for m in $(.sibling-modules)
31 m = [ path.basename $(m) ] ;
34 # Inject the type rule into the new module
35 IMPORT $(__name__) : type : $(m) : type ;