reorganized component and repository code into separate modules
[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
23 class Board(object):
24         def __init__(self, name, arch, gcc_march, gcc_mcpu='', gcc_mfpu='', gcc_options='', gnu_host='', flash_erase_size='65536', flash_pad_size='0'):
25                 self.name = name
26                 self.arch = arch
27                 self.gcc_march = gcc_march
28                 self.gcc_mcpu = gcc_mcpu
29                 self.gcc_mfpu = gcc_mfpu
30                 self.gcc_options = gcc_options
31                 self.gnu_host = gnu_host
32                 self.flash_erase_size = flash_erase_size
33                 self.flash_pad_size = flash_pad_size
34
35                 boards[name] = self
36
37 def Component(*args, **kwargs):
38         c = _components.Component(*args, **kwargs)
39         components[c.name] = c
40         return c
41
42 def PlatformProvidedComponent(*args, **kwargs):
43         c = _components.PlatformProvidedComponent(*args, **kwargs)
44         components[c.name] = c
45         return c