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

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [conts/] [libmem/] [SConstruct] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 drasko
#
2
# Copyright (C) 2007 Bahadir Balban
3
#
4
 
5
import os, glob, sys
6
from os.path import join
7
from string import split
8
 
9
PROJRELROOT = '../..'
10
sys.path.append(PROJRELROOT)
11
 
12
from configure import *
13
from config.projpaths import *
14
config = configuration_retrieve()
15
gcc_arch_flag = config.gcc_arch_flag
16
 
17
headers_root = join(PROJRELROOT, "include/l4")
18
config_h = join(headers_root, "config.h")
19
 
20
mm = "mm"
21
kmalloc = "kmalloc"
22
memcache = "memcache"
23
tests = "tests"
24
 
25
mm_dir = mm
26
kmalloc_dir = kmalloc
27
memcache_dir = memcache
28
tests_dir = tests
29
 
30
LIBL4_RELDIR = 'conts/libl4'
31
LIBL4_DIR = join(PROJROOT, LIBL4_RELDIR)
32
LIBL4_INCLUDE = join(LIBL4_DIR, 'include')
33
 
34
# This does not work, need to check
35
test_env = Environment(CC = config.toolchain_userspace + 'gcc',
36
                  CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', '-Wall', \
37 5 drasko
                     '-nostdinc', '-Werror'],
38 2 drasko
                  ENV = {'PATH' : os.environ['PATH']},
39
                  LIBS = ['mm', 'km', 'mc'],
40
                  LIBPATH = ['#'],
41
                  CPPPATH = ['#include', join(PROJRELROOT, "include"), "#", LIBL4_INCLUDE])
42
 
43
env = Environment(CC = config.toolchain_userspace + 'gcc',
44
            CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', \
45 5 drasko
                       '-Wall', '-Werror'],
46 2 drasko
            LINKFLAGS = ['-nostdlib'],
47
            ASFLAGS = ['-D__ASSEMBLY__'],
48
            ENV = {'PATH' : os.environ['PATH']},
49
            LIBS = 'gcc',
50
            CPPPATH = ['.', join(PROJROOT, 'include'), LIBL4_INCLUDE])
51
 
52
if os.path.exists(config_h) is False:
53
        print "\nThis build requires a valid kernel configuration header."
54
        print "Please run `scons configure' in the kernel root directory."
55
        print "Choose the `tests' target to build memory allocator tests,"
56
        print "or any other target for real use.\n"
57
        sys.exit()
58
 
59
mm_src = glob.glob("%s/*.c" % mm_dir)
60
kmalloc_src = glob.glob("%s/*.c" % kmalloc_dir)
61
memcache_src = glob.glob("%s/*.c" % memcache_dir)
62
tests_src = glob.glob ("%s/*.c" % tests_dir)
63
 
64
if "tests" in COMMAND_LINE_TARGETS:
65
        print "WARNING!!! Did you configure the kernel with test target first???"
66
        libmm = test_env.StaticLibrary(mm, mm_src)
67
        libkmalloc = test_env.StaticLibrary("km", kmalloc_src)
68
        libmemcache = test_env.StaticLibrary("mc", memcache_src)
69
        test_prog = test_env.Program("test", tests_src)
70
        env.Alias("tests", test_prog)
71
else:
72
        libmm = env.StaticLibrary(mm, mm_src)
73
        libkmalloc = env.StaticLibrary("km", kmalloc_src)
74
        libmemcache = env.StaticLibrary("mc", memcache_src)
75
 

powered by: WebSVN 2.1.0

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