I apparently had amnesia regarding dlopen().
[aesalon.git] / SConstruct
bloba319ec7bd01215bd81c8786882cff8d8628605b4
1 import sys
2 import os
4 colors = {}
5 colors["cyan"] = '\033[96m'
6 colors["purple"] = '\033[95m'
7 colors["blue"] = '\033[94m'
8 colors["green"] = '\033[92m'
9 colors["yellow"] = '\033[93m'
10 colors["red"] = '\033[91m'
11 colors["end"] = '\033[0m'
13 #If the output is not a terminal, remove the colors
14 if not sys.stdout.isatty():
15 for key, value in colors.iteritems():
16 colors[key] = ''
18 compile_source_message = '%sCompiling %s==> %s$SOURCE%s' % \
19 (colors['blue'], colors['purple'], colors['yellow'], colors['end'])
21 compile_shared_source_message = '%sCompiling shared %s==> %s$SOURCE%s' % \
22 (colors['blue'], colors['purple'], colors['yellow'], colors['end'])
24 link_program_message = '%sLinking Program %s==> %s$TARGET%s' % \
25 (colors['red'], colors['purple'], colors['yellow'], colors['end'])
27 link_library_message = '%sLinking Static Library %s==> %s$TARGET%s' % \
28 (colors['red'], colors['purple'], colors['yellow'], colors['end'])
30 ranlib_library_message = '%sRanlib Library %s==> %s$TARGET%s' % \
31 (colors['red'], colors['purple'], colors['yellow'], colors['end'])
33 link_shared_library_message = '%sLinking Shared Library %s==> %s$TARGET%s' % \
34 (colors['red'], colors['purple'], colors['yellow'], colors['end'])
36 env = Environment(
37 CXXCOMSTR = compile_source_message,
38 CCCOMSTR = compile_source_message,
39 SHCCCOMSTR = compile_shared_source_message,
40 SHCXXCOMSTR = compile_shared_source_message,
41 ARCOMSTR = link_library_message,
42 RANLIBCOMSTR = ranlib_library_message,
43 SHLINKCOMSTR = link_shared_library_message,
44 LINKCOMSTR = link_program_message,
46 ENV = {'PATH' : os.environ['PATH'],
47 'TERM' : os.environ['TERM'],
48 'HOME' : os.environ['HOME']})
50 Export('env')
52 def createConfig(target, source, values):
53 outFile = file(str(target), "w")
54 inFile = file(str(source), "r")
55 outFile.write(inFile.read() % values)
56 inFile.close()
57 outFile.close()
59 config = file("build/config", "r")
60 buildConfig = eval(config.read())
61 config.close()
63 createConfig("include/common/Config.h", "build/templates/Config.h.in", buildConfig)
65 SConscript("monitor/SConscript")
66 SConscript("modules/SConscript")
67 SConscript("tests/SConscript")