-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSConscript
More file actions
61 lines (49 loc) · 1.74 KB
/
SConscript
File metadata and controls
61 lines (49 loc) · 1.74 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
# -*- python -*-
### Python imports
from __future__ import print_function # python2/3 compatability
import glob
### SCons imports
Import('rootEnv')
def emit_version_header(target, source, env):
"""Populate the version header file with current SVN information."""
version_h = """
#ifndef _AFFY_VERSION_H_
#define _AFFY_VERSION_H_
#define AFFY_REVISION "%s"
extern const char affy_version[];
#endif
"""
try:
import pysvn
c = pysvn.Client()
subst = c.info(env.Dir('#/').abspath).revision.number
except ImportError:
from datetime import datetime
# subst = '(SVN, rev unknown)'
now = datetime.now()
subst = "build date: %s" % now.strftime("%Y-%m-%d %H:%M:%S")
try:
f = open(str(target[0]), mode='w')
print (version_h % (subst,), file=f)
f.close()
except:
return 1
return None
### Subdirectories containing libaffy source files. Each of these will
### be globbed for .c files.
srcsubdirs = ['io', 'mas5', 'rma', 'utils', 'halloc', 'iron_generic', 'iron']
libsrcs = []
for dir in srcsubdirs:
libsrcs += glob.glob(dir + '/*.c')
### Generate the current version header file.
version_h = rootEnv.Command('include/affy_version.h',
None,
emit_version_header)
#libsrcs.append('swigtest/libaffy.i')
### Build both shared and static versions of libaffy.
rootEnv.StaticLibrary(target = 'affy', source = libsrcs)
#rootEnv.SharedLibrary(target = 'affy', source = libsrcs)
### Documentation target. Building the docs can be fairly tricky if
### your platform is weird. So by default leave them alone.
if ARGUMENTS.get('build_docs', 0):
SConscript('doc/SConscript', exports=['rootEnv'])