Belle II Software light-2406-ragdoll
output.py
1#!/usr/bin/env python
2
3
10
11from SCons.Script import GetOption
12
13# compile: blue
14# link : green
15# install: purple
16# copy : purple
17# map : cyan
18# dict : yellow
19# doc : gray
20# cleanup: black/white
21# strip : black/white
22
23color_map_none = {
24 'end': '',
25 'compile': '',
26 'link': '',
27 'install': '',
28 'copy': '',
29 'map': '',
30 'dict': '',
31 'doc': '',
32 'cleanup': '',
33 'strip': '',
34}
35color_map_light = {
36 'end': '\033[0m',
37 'compile': '\033[94m',
38 'link': '\033[92m',
39 'install': '\033[95m',
40 'copy': '\033[95m',
41 'map': '\033[96m',
42 'dict': '\033[93m',
43 'doc': '\033[37m',
44 'cleanup': '\033[37m',
45 'strip': '\033[37m',
46}
47color_map_dark = {
48 'end': '\033[0m',
49 'compile': '\033[2m\033[34m',
50 'link': '\033[2m\033[32m',
51 'install': '\033[2m\033[35m',
52 'copy': '\033[2m\033[35m',
53 'map': '\033[2m\033[36m',
54 'dict': '\033[2m\033[33m',
55 'doc': '\033[90m',
56 'cleanup': '\033[30m',
57 'strip': '\033[30m',
58}
59
60
61def generate(env):
62 color_map = color_map_none
63 if GetOption('color') == 'light':
64 color_map = color_map_light
65 elif GetOption('color') == 'dark':
66 color_map = color_map_dark
67
68 if not GetOption('verbose'):
69 if GetOption('no-symlink'):
70 install_text = 'installing'
71 else:
72 install_text = 'symlinking'
73 env.Replace(
74 SHCXXCOMSTR='${CXXCOMSTR}',
75 CXXCOMSTR=color_map['compile'] + '*** compiling : ${SOURCE}' + color_map['end'],
76 FORTRANPPCOMSTR='${CXXCOMSTR}',
77 SHFORTRANPPCOMSTR='${CXXCOMSTR}',
78 CCCOMSTR='${CXXCOMSTR}',
79 SHCCCOMSTR='${CXXCOMSTR}',
80 SHLINKCOMSTR='${LINKCOMSTR}',
81 LINKCOMSTR=color_map['link'] + '*** linking : ${TARGET}' + color_map['end'],
82 INSTALLSTR=color_map['install'] + '*** ' + install_text + ' : ${TARGET}' + color_map['end'],
83 COPYCOMSTR=color_map['copy'] + '*** copying : ${TARGET}' + color_map['end'],
84 MAPCOMSTR=color_map['map'] + '*** map : ${TARGET}' + color_map['end'],
85 ROOTCLINGCOMSTR=color_map['dict'] + '*** dictionary : ${TARGET}' + color_map['end'],
86 CLASSVERSIONCOMSTR=color_map['dict'] + '*** checking : ${SOURCE}' + color_map['end'],
87 MODULEIOCOMSTR=color_map['doc'] + '*** module-io : ${TARGET}' + color_map['end'],
88 DOXYGENCOMSTR=color_map['doc'] + '*** doxygen : ${TARGET}' + color_map['end'],
89 STRIPCOMSTR=color_map['strip'] + '*** stripping : ${TARGET}' + color_map['end'],
90 )
91
92 env['CLEANUPCOMSTR'] = color_map['cleanup'] + '*** removing : %s' \
93 + color_map['end']
94
95
96def exists(env):
97 return True