-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathSConstruct
More file actions
74 lines (58 loc) · 2.34 KB
/
SConstruct
File metadata and controls
74 lines (58 loc) · 2.34 KB
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
##
# libcryptoplus build file.
#
module = 'cryptoplus'
major = '1'
minor = '3'
### YOU SHOULD NEVER CHANGE ANYTHING BELOW THIS LINE ###
import sys, os
include_path = os.path.join('include', module)
submodules = [''] + os.walk(include_path).next()[1]
source = Glob('src/*.cpp')
include = dict()
for submodule in submodules: include[submodule] = Glob(os.path.join(include_path, submodule, '*.hpp'))
cpppath = [include_path]
libs = ['crypto']
# Import the customized environment
sys.path.append(os.path.abspath('scons'))
import environment
env = environment.Environment(ENV = os.environ.copy())
# Build the libraries
libraries = env.Libraries(module, major, minor, source, CPPPATH = cpppath, LIBS = libs)
documentation = env.Documentation()
indentation = env.Indentation(source + include.values())
include_install = []
for (k, v) in include.items():
include_install += [env.Install(os.path.join(env['install_path'], 'include', module, k), v)]
libraries_install = env.Install(os.path.join(env['install_path'], env.libdir), libraries)
install = [include_install, libraries_install]
# Call the test SConstruct file
run_tests = SConscript('tests/SConscript', exports = 'env module libraries')
samples = SConscript('samples/SConscript', exports = 'env module libraries')
# Aliases
env.Alias('build', libraries)
env.Alias('install', install)
env.Alias('doc', documentation)
env.Alias('indent', indentation)
env.Alias('tests', run_tests)
env.Alias('samples', samples)
env.Alias('all', ['build', 'samples', 'doc'])
env.Alias('release', ['indent', 'all', 'tests'])
# Help documentation
Help("""Usage:
'scons build' to build the library.
'scons install' to install the library and its include files on the system.
'scons doc' to build the documentation.
'scons tests' to build the library, the tests and then run the tests.
'scons samples' to build the library and the samples.
'scons all' to build the library, the samples and the documentation.
'scons release' to indent the code, build everything then run the tests.
'scons -c' to cleanup object and libraries files.
'scons -c install' to uninstall libraries and include files.
'scons -c doc' to cleanup documentation files.
'scons -c all' to cleanup libraries and documentation files.
If scons is called without parameters, the default target is "build".
Available options:
%s""" % env.variables_help_text)
# Default
Default('build')