-
Notifications
You must be signed in to change notification settings - Fork 44
/
drakefile
81 lines (68 loc) · 1.89 KB
/
drakefile
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
import drake
config = None
headers = None
library = None
lib_dynamic = None
rule_build = None
rule_check = None
rule_install = None
rule_tests = None
def configure(cxx_toolkit,
cxx_config,
boost,
elle,
reactor,
prefix,
valgrind,
valgrind_tests):
global config, library, lib_dynamic
config = drake.cxx.Config(elle.config)
config.add_local_include_path('src')
local_config = drake.cxx.Config(cxx_config)
local_config += config
local_config += boost.config()
## ----- ##
## Rules ##
## ----- ##
global rule_build
rule_build = drake.Rule('build')
global rule_check
rule_check = drake.Rule('check')
global rule_install
rule_install = drake.Rule('install')
global rule_tests
rule_tests = drake.Rule('tests')
## ------- ##
## Library ##
## ------- ##
libs = [drake.copy(l, 'lib') for l in [elle.library, reactor.library]]
sources = drake.nodes(
'src/elle/nbd/Server.cc',
'src/elle/nbd/Server.hh',
)
library = drake.cxx.DynLib('lib/nbd', sources, cxx_toolkit, local_config)
lib_dynamic = library
rule_build << library
## -------- ##
## Binaries ##
## -------- ##
nbd_file = drake.cxx.Executable(
'bin/nbd-file',
drake.nodes('bin/nbd-file.cc') + [library] + libs,
cxx_toolkit,
local_config +
boost.config_system() +
boost.config_filesystem() +
elle.config)
rule_build << nbd_file
## ------- ##
## Install ##
## ------- ##
global headers
headers = (node for node in sources if isinstance(node, drake.cxx.Header))
if prefix is not False:
prefix = drake.Path(prefix)
rule_install << drake.install(library, prefix / 'lib', strip_prefix = True)
rule_install << drake.install(
headers, prefix / 'include', strip_prefix = 'src')
rule_install << drake.install(nbd_file, prefix / 'bin', strip_prefix = True)