forked from caesar0301/pkt2flow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SConstruct
executable file
·38 lines (29 loc) · 877 Bytes
/
SConstruct
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
#!/usr/bin/env python
import sys
env = Environment(CCFLAGS='-Wall -g', CPPFLAGS='-D_GNU_SOURCE')
AddOption('--prefix',
dest='prefix',
nargs=1, type='string',
action='store',
metavar='DIR',
help='installation prefix')
env = Environment(PREFIX = GetOption('prefix'))
idir_prefix = '$PREFIX'
idir_bin = '$PREFIX/bin'
Export('env idir_prefix idir_bin')
platform = sys.platform
lib_path = ['/usr/local/lib', '/usr/lib']
libs = Glob('./*.a') + ['pcap']
cpp_path=['.']
if platform == 'darwin':
env.Append(CPPFLAGS=['-Ddarwin'])
# Compile the programs
pkt2flow = env.Program(target = './pkt2flow',
source = Glob('./*.c'),
LIBPATH = lib_path,
LIBS = libs,
CPPPATH = cpp_path)
# install the program
env.Install(dir = idir_bin, source = pkt2flow)
# create an install alias
env.Alias('install', idir_prefix)