OpenCores
URL https://opencores.org/ocsvn/c0or1k/c0or1k/trunk

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [conts/] [libc/] [SConstruct] - Blame information for rev 2

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 drasko
# -*- mode: python; coding: utf-8; -*-
2
#
3
#  Codezero -- a microkernel for embedded systems.
4
#
5
#  Copyright © 2009  B Labs Ltd
6
#
7
import os, sys
8
 
9
PROJRELROOT = '../..'
10
 
11
sys.path.append(PROJRELROOT)
12
 
13
from config.projpaths import *
14
from config.configuration import *
15
 
16
config = configuration_retrieve()
17
gcc_arch_flag = config.gcc_arch_flag
18
arch = config.arch
19
 
20
# We assume we are compiling for userspace.
21
# variant can be specified from cmdline using
22
# scons variant=xxx
23
variant = ARGUMENTS.get('variant', 'userspace')
24
print '\nCompiling for variant: ' + variant + '\n'
25
 
26
# Needed by fputc(), for declaration of uart_tx()
27
LIBDEV_RELDIR = 'conts/libdev'
28
LIBDEV_DIR = join(PROJROOT, LIBDEV_RELDIR)
29
LIBDEV_INC = join(LIBDEV_DIR, 'include')
30
 
31
env = Environment(CC = config.toolchain_userspace + 'gcc',
32
                  CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', \
33
                     '-nostdinc', '-Wall', '-Werror', '-march=' + gcc_arch_flag],
34
                  LINKFLAGS = ['-nostdlib'],
35
                  ASFLAGS = ['-D__ASSEMBLY__'],
36
                  ENV = {'PATH' : os.environ['PATH']},
37
                  CPPPATH = ['include', LIBDEV_INC, join(PROJROOT,'include'), \
38
                     'include/sys-' + variant + '/arch-' + arch])
39
 
40
source = \
41
    Glob('src/*.[cS]') + \
42
    Glob('src/sys-' + variant + '/*.c') + \
43
    Glob('src/sys-' + variant + '/arch-' + arch + '/*.c') + \
44
    Glob('src/arch-' + arch + '/*.c') + \
45
    Glob('src/arch-' + arch + '/*.S') + \
46
    Glob('crt/sys-' + variant + '/arch-' + arch + '/*.[cS]')
47
 
48
objects = env.StaticObject(source)
49
library = env.StaticLibrary('c-' + variant, objects)
50
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.