-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathwscript
More file actions
78 lines (61 loc) · 2.32 KB
/
wscript
File metadata and controls
78 lines (61 loc) · 2.32 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
75
76
77
78
import platform
top='.'
out='.build'
def options(opt):
opt.load('compiler_cxx')
def configure(conf):
conf.load('compiler_cxx')
# for debug
#option = '-g'
#option = '-g -pg'
# normal optimization.
option = '-O3 -Wall -DNDEBUG -g'
#option = '-O3 -Wall -DNDEBUG -g -pg'
conf.env['CFLAGS']=option.split(" ")
conf.env['CXXFLAGS']=option.split(" ")
conf.env['LIB']=['pthread']
if platform.system() != "Darwin":
conf.env['LIB'].append('SegFault')
conf.env['INCLUDES']=['darts-clone']
conf.define("DALM_MAX_ORDER",6)
def build(bld):
bld.recurse('scripts')
projname = 'dalm'
includes = ['include']
use = [projname]
###### INSTALL HEADERS ######
headers = ['arpafile.h', 'da.h', 'dalm.h', 'fileutil.h', 'fragment.h', 'handler.h', 'logger.h', 'pthread_wrapper.h', 'state.h', 'treefile.h', 'value_array.h', 'value_array_index.h', 'vocabulary.h', 'vocabulary_file.h', 'version.h']
headers = map(lambda x:'include/%s'%x, headers)
bld.install_files('${PREFIX}/include', headers)
headers = ['darts.h']
headers = map(lambda x:'darts-clone/%s'%x, headers)
bld.install_files('${PREFIX}/darts-clone', headers)
###### BUILD DALM LIB ######
files = ['embedded_da.cpp', 'dalm.cpp', 'fragment.cpp', 'logger.cpp', 'vocabulary.cpp', 'value_array.cpp', 'vocabulary_file.cpp']
files = map(lambda x: 'src/%s'%x, files)
lib = bld.stlib(source=' '.join(files), target=projname)
lib.includes = ['include']
bld.install_files('${PREFIX}/lib/', ['lib%s.a'%projname])
###### BUILD MKWORDDICT ######
files = ['mkworddict.cpp']
files = map(lambda x: 'src/%s'%x, files)
builder = bld.program(source=' '.join(files), target='mkworddict')
builder.use = use
builder.includes = includes
###### BUILD DALM BUILDER ######
files = ['builder.cpp']
files = map(lambda x: 'src/%s'%x, files)
builder = bld.program(source=' '.join(files), target=projname+'_builder')
builder.use = use
builder.includes = includes
###### BUILD SAMPLES ######
files = ['query_sample.cpp']
files = map(lambda x: 'sample/%s'%x, files)
builder = bld.program(source=' '.join(files), target='query_sample')
builder.use = use
builder.includes = includes
files = ['query_with_state_sample.cpp']
files = map(lambda x: 'sample/%s'%x, files)
builder = bld.program(source=' '.join(files), target='query_with_state_sample')
builder.use = use
builder.includes = includes