update TODO
[luccawm.git] / SConstruct
blob71c4b6c65ac1b8feb699ce5d1aab61171df89c76
1 # Copyright (c) 2008 Vincent Povirk
3 # Permission is hereby granted, free of charge, to any person
4 # obtaining a copy of this software and associated documentation
5 # files (the "Software"), to deal in the Software without
6 # restriction, including without limitation the rights to use,
7 # copy, modify, merge, publish, distribute, sublicense, and/or sell
8 # copies of the Software, and to permit persons to whom the
9 # Software is furnished to do so, subject to the following
10 # conditions:
12 # The above copyright notice and this permission notice shall be
13 # included in all copies or substantial portions of the Software.
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 # OTHER DEALINGS IN THE SOFTWARE.
24 import subprocess
26 project_env = Environment()
27 Export('project_env')
29 if ARGUMENTS.get('debug', 1) not in [0, '0']:
30 project_env.MergeFlags('-g -DLUCCA_DEBUG')
31 debug = True
32 else:
33 project_env.MergeFlags('-O')
34 debug = False
35 Export('debug')
37 project_env.MergeFlags('-Wall -Wno-unused-function -Werror')
39 def pkgconfig(env, package):
40 #this is annoying; because ParseConfig doesn't like arguments that contain spaces, I have to do this manually
41 pc = subprocess.Popen(['pkg-config', package, '--cflags', '--libs'], stdout=subprocess.PIPE)
42 flags = pc.stdout.read()
43 if pc.wait() == 0: #pkg-config exited successfully
44 env.MergeFlags(flags)
45 else: #pkg-config failed and printed an error message
46 Exit(1)
47 Export('pkgconfig')
49 Mkdir('include')
50 project_include = Dir('include') #directory for this project's headers
51 project_env.Prepend(CPPPATH=project_include)
52 Export('project_include')
54 #bin module
55 bin_files, bin_config = SConscript('bin/SConscript')
56 Export('bin_files bin_config')
58 #Layout module
59 layout_files, layout_config = SConscript('layout/SConscript')
60 Export('layout_files layout_config')
62 #X Window Management module
63 display_files, display_config = SConscript('xwm/SConscript')
64 Export('display_files display_config')
66 if debug:
67 #crashcatcher
68 cc_files, cc_config = SConscript('crashcatcher/SConscript')
69 Export('cc_files cc_config')
71 #Core module
72 core_files, core_config = SConscript('core/SConscript')
73 Export('core_files core_config')
75 #loader program
76 SConscript('loader/SConscript')
78 if ARGUMENTS.get('test', 0) not in [0, '0']:
79 #test programs
80 SConscript('layout/test/SConscript')
81 SConscript('xwm/test/SConscript')