File: Jamroot.jam

package info (click to toggle)
mcrl2 201007~rc1-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 28,524 kB
  • ctags: 34,862
  • sloc: cpp: 251,100; ansic: 19,553; python: 12,151; yacc: 10,042; sh: 3,185; lex: 2,040; xml: 279; makefile: 193
file content (205 lines) | stat: -rw-r--r-- 6,979 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# Author: Jeroen van der Wulp
#
#  Copyright (C) 2008 Eindhoven University of Technology.
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
# Main build description containing custom rules to make project descriptions more compact.
#
#  Options:
#
#   Build:
#
#    --enable-debug                 sets: debug-symbols=on runtime-debugging=on
#
#    --enable-profile               sets: profiling=on
#
#    --enable-optimisation          sets: optimization=speed inlining=full
#
#    --disable-squadt-support       disables squadt support in tools
#
#    --enable-experimental          activates building/installing of tools that are marked experimental
#
#    --enable-deprecated            activates building/installing of tools that are marked deprecated
#
#    --no-display-notice            configuration notice message are not printed
#
#    --install-boost-headers        installs the Boost header files (temporary measure until Boost 1.35 has become mainstream)
#
#   Installation:
#
#    --prefix                       directory relative to which tools/libraries, documentation and examples
#                                   are installed, unless one of the following options is also specified
#
#                                   Note: always do a clean build after changing the prefix!
#
#    --bindir                       directory where binaries are installed
#
#    --libdir                       directory where libraries are installed
#
#    --includedir                   directory where header files are installed
#
#    --datadir                      directory where data is installed
#
#    --mandir                       directory where man pages are installed
#
#    --destdir                      direcory that is prepended to all of the above paths for installation,
#                                   the built takes place as-if everything would be installed according to
#                                   be above arguments (for binary packaging)
#

import feature ;
import path ;
import property ;
import regex ;
import set ;
import testing ;

import build/man ;
import build/install ;

if [ modules.peek : OS ] = MACOSX {
  import build/macosx/mac-bundle ;
}

# Constants for commonly used paths
path-constant TOP : . ;

# Activate header cache
modules.poke : HCACHEFILE : $(TOP)/build/bin/.jamdeps ;

load-configuration $(TOP)/build config.jam ;

# Some sub projects
use-project /site-config : build ;
use-project /libraries   : libraries ;

# Register individual library projects
libraries = [ MATCH (.*)/build/Jamfile.v2 : [ glob-tree Jamfile.v2 : .svn ] ] ;

for library in [ MATCH (.*libraries/[^//]*)$ : $(libraries) ]
               [ MATCH (.*3rd-party/[^//]*)$ : $(libraries) ] {
  local name = [ MATCH .*/([^//]*)$ : $(library) ] ;

  use-project /libraries/$(name) : $(library)/build ;
}

constant      INSTALL_ROOT : [ get-install-root ] ;
constant      PLUGIN_ROOT  : [ get-plugin-root ] ;
constant      BUILD_TAG    : [ get-build-tag ] ;
path-constant BOOST_ROOT   : [ get-boost-path ] ;  # Boost prefix

# Top project
project toolset
       : build-dir build/bin
       : requirements
          <conditional>@build/install.platform-configuration
          <define>_FILE_OFFSET_BITS=64
          <include>./build/workarounds
          [ build/install.feature-configuration ]
       : default-build
          <variant>debug
          [ build/install.default-configuration ]
       ;


# Only from the root of the source tree
if [ path.exists ./tools ] {
  tools = [ MATCH .*/?tools/(.*)/.* : [ glob tools/*/Jamfile.v2 ] ] ;

  local targets  = [ set.intersection [ MATCH "^([0-9a-zA-Z_]+)$" : [ modules.peek : ARGV ] ] : $(tools) ] ;
  local disabled = [ MATCH "^--disable-tools=([,0-9a-zA-Z_]+)$" : [ modules.peek : ARGV ] ] ;

  if ! $(targets) {
    targets = $(tools) ;
  }
  if $(disabled) {
    targets = [ set.difference $(targets) : [ regex.split "$(disabled)" "," ] ] ;
  }

  # Register tool projects
  for tool in $(targets) {
    # Register tool projects
    use-project /tools/$(tool) : tools/$(tool) ;
  }

  if [ feature.defaults <install> ] != <install>yes {
    # Introduce tool targets
    for tool in $(targets) {
      alias $(tool) : /tools/$(targets)//install : <location>build/stage ;
    }

    if ! $(tools) in $(targets) {
      ECHO "Building selected tools :" $(targets) ;
    }
  }
  else {
    if ! $(tools) in $(targets) {
      ECHO "Installing selected tools only :" $(targets) ;

      # Introduce tool targets
      for tool in $(targets) {
        alias $(tool) : /tools/$(targets)//install : <link>shared:<source>/libraries//install/<link>shared ;
      }

      alias install : $(targets) ;
    }
    else {
      local boost-headers = [ MATCH --(install-boost-headers) : [ modules.peek : ARGV ] ] ;

      # Complete install
      alias install : /tools/$(tools)//install /libraries//install examples $(boost-headers) ;

      if $(boost-headers) { 
        local all-boost-headers = [ MATCH (3rd-party/boost/boost/.*)$ : [ glob-tree *.hpp *.ipp : .svn ] ] ;
        local header-location   = [ path.join [ get-install-root ] "include" ] ;

        install install-boost-headers : [ set.difference $(all-boost-headers) :
          [ MATCH (.*asio.*)|(.*xpressive.*)|(.*filesystem.*)|(.*test.*)|(.*thread.*)|(.*signal.*)|(.*program_options.*)|(.*aux_/preprocessed/.*) : $(all-boost-headers) ] ]
                : <location>$(header-location) <install-type>H <install-source-root>3rd-party/boost ;

        explicit install-boost-headers ;
      }

      # General examples
      install-data examples
              : [ path.glob-tree $(TOP)/examples : *.gra *.dgc *.dgd *.txt *.mcrl2 *.pnml *.mcf *.fsm *.trc README project.xml : .svn ]
              : <install-source-root>./examples
                <data-sub-location>examples
              ;
    }
  }
}


# For plugins (dynamic linked libraries)
rule plugin ( name : sources * : requirements * : defaults * : usage-requirements * ) {
  requirements = [ process-requirements $(requirements) ] ;

  if ! <build>no in $(requirements) {
    lib $(name) : $(sources) : $(requirements) <link>shared <toolset>darwin:<bundle>yes : $(defaults) : $(usage-requirements) ;
  }
  else {
    alias $(name) ;
  }
}

# Target for a tool in the mCRL2 toolset
rule tool ( name : sources * : requirements * : defaults * : usage-requirements * ) {
  build-requirements = [ process-requirements $(requirements) ] [ property.select install-rule : $(requirements) ] ;

  if ! <build>no in $(build-requirements) {
    exe $(name) : $(sources)
                : $(build-requirements)
                  <library>/libraries/utilities//command_line_interface
                : $(defaults) : $(usage-requirements) ;

    # generate install targets
    install-tool $(name) : $(requirements) ;
  }
  else {
    install-tool $(name) : $(build-requirements) ;
  }
}