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

Subversion Repositories c0or1k

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 drasko
# -*- mode: python; coding: utf-8; -*-
2
#
3
#  Codezero -- Virtualization microkernel for embedded systems.
4
#
5
#  Copyright © 2009  B Labs Ltd
6
#
7
import os, shelve, sys
8
from os.path import *
9
 
10
PROJRELROOT = '../../../'
11
 
12
sys.path.append(PROJRELROOT)
13
 
14
from config.projpaths import *
15
from config.configuration import *
16
 
17
config = configuration_retrieve()
18
arch = config.arch
19
 
20
LIBL4_RELDIR = 'conts/libl4'
21
KERNEL_INCLUDE = join(PROJROOT, 'include')
22
LIBL4_DIR = join(PROJROOT, LIBL4_RELDIR)
23
LIBL4_INCLUDE = join(LIBL4_DIR, 'include')
24
LIBL4_LIBPATH = join(BUILDDIR, LIBL4_RELDIR)
25
 
26
# Locally important paths are here
27
LIBC_RELDIR = 'conts/libc'
28
LIBC_DIR = join(PROJROOT, LIBC_RELDIR)
29
LIBC_LIBPATH = join(BUILDDIR, LIBC_RELDIR)
30
LIBC_INCLUDE = [join(LIBC_DIR, 'include'), \
31
                join(LIBC_DIR, 'include/arch' + '/' + arch)]
32
 
33
env = Environment(CC = config.toolchain_userspace + 'gcc',
34
                  # We don't use -nostdinc because sometimes we need standard headers,
35
                  # such as stdarg.h e.g. for variable args, as in printk().
36
                  CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', \
37
                             '-std=gnu99', '-Wall', '-Werror'],
38
                  LINKFLAGS = ['-nostdlib', '-T' + "include/linker.lds", \
39
                       LIBC_LIBPATH, LIBL4_LIBPATH, LIBMEM_LIBPATH],
40
                  ASFLAGS = ['-D__ASSEMBLY__'],
41
                  PROGSUFFIX = '.elf',                  # The suffix to use for final executable
42
                  ENV = {'PATH' : os.environ['PATH']},  # Inherit shell path
43
                  LIBS = ['gcc', 'libl4', 'libc', 'libmm', 'libmc'],
44
          CPPPATH = ["#include", LIBC_INCLUDE, KERNEL_INCLUDE, LIBL4_INCLUDE],
45
                  CPPFLAGS = '-include l4/config.h -include l4/macros.h -include l4/types.h -D__KERNEL__')
46
 
47
 
48
 
49
def create_symlinks(arch):
50
        arch_path = "include/arch"
51
        arch_path2 ="src/arch"
52
        if os.path.exists(arch_path):
53
                os.system("rm %s" % (arch_path))
54
        os.system("ln -s %s %s" % ("arch-" + arch, arch_path))
55
        if os.path.exists(arch_path2):
56
                os.system("rm %s" % (arch_path2))
57
        os.system("ln -s %s %s" % ("arch-" + arch, arch_path2))
58
 
59
src = Glob(['*.c', 'src/*.c', 'src/lib/*.c', 'src/lib/elf/*.c', 'src/arch/*.c'])
60
 
61
objects = []
62
mm0_elf = env.Program('mm0.elf', objects)

powered by: WebSVN 2.1.0

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