File: make.jam

package info (click to toggle)
boost-build 2.0-m11-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 4,624 kB
  • ctags: 2,387
  • sloc: ansic: 12,978; python: 5,209; xml: 4,782; cpp: 555; yacc: 456; sh: 237; makefile: 71
file content (68 lines) | stat: -rw-r--r-- 2,328 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#  Copyright (C) Vladimir Prus 2002. Permission to copy, use, modify, sell and
#  distribute this software is granted provided this copyright notice appears in
#  all copies. This software is provided "as is" without express or implied
#  warranty, and with no claim as to its suitability for any purpose.

#  This module defines the 'make' main target rule.

import targets ;
import "class" : new ;
import property ;
import errors : error ;
import type : type ;
import regex ;
import property-set ;
import project ;

class make-target-class : basic-target
{
    import type regex virtual-target ;    
    import "class" : new ;
    
    rule __init__ ( name : project : sources * : requirements * : default-build * )
    {     
        basic-target.__init__ $(name) : $(project) : $(sources) 
          : $(requirements) : $(default-build) ;
    }
        
    rule construct ( name : source-targets * : property-set )
    {
        local action-name = [ $(property-set).get <action> ] ;        
        # 'm' will always be set -- we add '@' outselfs in 'make'
        # rule below.
        local m = [ MATCH ^@(.*) : $(action-name) ] ;
                        
        local a = [ new action $(source-targets) : $(m[1])
                    : $(property-set) ] ;        
        local t = [ new file-target $(self.name) exact 
          : [ type.type $(self.name) ] : $(self.project) : $(a) ] ;        
        return [ property-set.empty ] [ virtual-target.register $(t) ] ;
    }   
}

# Declares the 'make' main target.
rule make ( target-name : sources * : generating-rule + : requirements * )
{
    local project = [ project.current ] ;
    
    # The '@' sign causes the feature.jam module to qualify rule name
    # with the module name of current project, if needed.
    local m = [ MATCH ^(@).* : $(generating-rule) ] ;
    if ! $(m)
    {
        generating-rule = @$(generating-rule) ;
    }        
    requirements += <action>$(generating-rule) ;
    
    targets.main-target-alternative
     [ new make-target-class $(target-name) : $(project)
       : [ targets.main-target-sources $(sources) : $(target-name) ] 
       : [ targets.main-target-requirements $(requirements) : $(project) ] 
       : [ targets.main-target-default-build : $(project) ] 
     ] ;
         
}

IMPORT $(__name__) : make : : make ;