-k option builds as many components as possible
[matrix.git] / matrix / config.py
1 # Copyright (C) 2007-2008 Movial Oy
2 # Authors: Timo Savola <tsavola@movial.fi>
3 #          Kalle Vahlman <kalle.vahlman@movial.fi>
4
5 import os as _os
6 import components as _components
7
8 top_dir = _os.environ.get('MATRIX_TOPDIR', '')
9 cache_dir = _os.path.join(top_dir, 'build-cache')
10 global_cache_dir = '/usr/share/matrix/build-cache'
11 script_dir = None
12
13 boards = {}
14 board = None
15 components = {}
16 roots = []
17 flags = []
18 libc = 'glibc'
19 verbose = False
20 debug = False
21 force = False
22 keep_going = False
23
24 class Board(object):
25         def __init__(self, name, arch, gcc_march, gcc_mcpu='', gcc_mfpu='', gcc_options='', gnu_host='', flash_erase_size='65536', flash_pad_size='0'):
26                 self.name = name
27                 self.arch = arch
28                 self.gcc_march = gcc_march
29                 self.gcc_mcpu = gcc_mcpu
30                 self.gcc_mfpu = gcc_mfpu
31                 self.gcc_options = gcc_options
32                 self.gnu_host = gnu_host
33                 self.flash_erase_size = flash_erase_size
34                 self.flash_pad_size = flash_pad_size
35
36                 boards[name] = self
37
38 def Component(*args, **kwargs):
39         c = _components.Component(*args, **kwargs)
40         components[c.name] = c
41         return c
42
43 def PlatformProvidedComponent(*args, **kwargs):
44         c = _components.PlatformProvidedComponent(*args, **kwargs)
45         components[c.name] = c
46         return c