-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSConstruct
74 lines (62 loc) · 2.67 KB
/
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
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
# -*- python -*-
# Version is for the moment hardcoded but will be optained from vcs
version = '0.2'
# look at site_scons/site_init.py for options
Import("*") # for old version of scons (1.0.1 for example variable in
# site_init.py are not directly visible from SConstruct so
# Import/Export are used
# = Environment =======================================================
env = Environment(PREFIX = PREFIX,
LIBPATH = LIBPATH,
CCFLAGS = CCFLAGS + ['-DEXPORT_DLL'],
tools = TOOLS)
# = Configuration =====================================================
if not env.GetOption('clean'):
conf = Configure(env)
conferror = False
for l in ['usb', 'ftdi1']:
if not conf.CheckLib(l):
conferror = True
if conferror:
print 'Configure failed, exiting !'
Exit(1)
env = conf.Finish()
# = Compilation =======================================================
lib = env.SharedLibrary(LIBDIR + '/ftdispi', ['src/ftdispi.c'])
bin = env.Program('bin/spitest', ['src/spitest.c', 'src/ftdispi.c'])
# = Default Target ====================================================
Default(lib + bin)
# = Installation ======================================================
install = env.Install('$PREFIX/include', 'src/ftdispi.h')
for i in bin:
install += env.Install('$PREFIX/bin', i)
for i in lib:
install += env.InstallSharedLib('$PREFIX/'+ LIBDIR, str(i), version)
env.Alias('install', install)
# = Distclean =========================================================
env.Clean('distclean', ['.sconsign.dblite',
'.sconf_temp',
'config.log',
LIBDIR,
'bin',
'share/doc',
'share/man',
'src/ftdispi.os'])
# Packaging does not work for the moment
#try:
# release = '.'.join(platform.release().split('.')[-2:])
# release = '.' + release
#except:
# release = ''
#pkg = env.Package(NAME = 'libftdispi',
# VERSION = version,
# PACKAGEVERSION = '1' + release,
# PACKAGETYPE = 'rpm',
# LICENSE = 'new BSD',
# SUMMARY = 'Library to program and control the FTDI USB controller as a SPI Master',
# DESCRIPTION = 'A library (using libftdi1 and so libusb) to use FTDI devices including FT4232H and FT2232H as a SPI master',
# X_RPM_GROUP = '',
# SOURCE_URL = 'http://code.google.com/p/libftdispi/',
# source = install)
#
#env.Alias('rpm', pkg)