-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSConstruct
32 lines (26 loc) · 887 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
#
# SConstruct for TvGuideFetch.
#
# Builds specified by mode=debug or mode=release on the command line
buildMode = ARGUMENTS.get('mode', 'release')
if not (buildMode in ['debug', 'release']):
print "Error: expect mode=debug or mode=release, found: " + buildMode
Exit(1)
# Configure common items in the environment
env = Environment()
env.Append(CPPDEFINES = '_GNU_SOURCE')
env.Append(CCFLAGS = ['-Wall'])
# Taylor the environment for a release build
if buildMode == 'release':
env.Append(CCFLAGS = ['-Os'])
# Taylor the environment for a debug build
if buildMode == 'debug':
env.Append(CPPDEFINES = 'DEBUG')
env.Append(CCFLAGS = ['-Og', '-g'])
bldDir = 'build/' + buildMode + '/'
SConscript('SConscript', exports = 'env bldDir')
Clean('build', bldDir)
Clean('.', 'build')
# Install rule
env.Install('/usr/bin', bldDir + 'tv_grab_au_tvguide')
env.Alias('install', '/usr/bin')