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

Subversion Repositories eco32

[/] [eco32/] [trunk/] [lcc/] [etc/] [eco32-netbsd.c] - Blame information for rev 65

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

Line No. Rev Author Line
1 4 hellwig
/* Code for ECO32 under NetBSD, University of Applied Sciences Giessen */
2
 
3
#include <string.h>
4
 
5
char *suffixes[] = { ".c", ".i", ".s", ".o", ".out", 0 };
6
 
7
char inputs[256] = "";
8
 
9
char *cpp[] = {
10
        LCCDIR "cpp",
11
        "-D__STDC__=1",
12
        "-DLANGUAGE_C",
13
        "-D_LANGUAGE_C",
14
        "-DECO32",
15
        "-D_ECO32",
16
        "-Deco32",
17
        "-DUNIX",
18
        "-D_UNIX",
19
        "-Dunix",
20
        "$1",                   /* preprocessor include directory */
21
        "$2",                   /* preprocessor input file */
22
        "$3",                   /* preprocessor output file */
23
 
24
};
25
 
26
char *com[] =  {
27
        LCCDIR "rcc",
28
        "-target=eco32/netbsd",
29
        "$1",                   /* other options handed through */
30
        "$2",                   /* compiler input file */
31
        "$3",                   /* compiler output file */
32
        "",
33
 
34
};
35
 
36
char *include[] = { "-I" LCCDIR "../include", 0 };
37
 
38
char *as[] = {
39
        LCCDIR "as",
40
        "-o", "$3",             /* assembler output file */
41
        "$1",                   /* other options handed through */
42
        "$2",                   /* assembler input file */
43
 
44
};
45
 
46
char *ld[] = {
47
        LCCDIR "ld",
48
        "-o", "$3",             /* linker output file */
49
        "$1",                   /* other options handed through */
50
        LCCDIR "../lib/c0.o",
51
        "$2",
52
        LCCDIR "../lib/setjmp.o",
53
        LCCDIR "../lib/eos32sys.o",
54
        LCCDIR "../lib/eos32lib.o",
55
        LCCDIR "../lib/assert.o",
56
        LCCDIR "../lib/ctype.o",
57
        LCCDIR "../lib/errno.o",
58
        LCCDIR "../lib/math.o",
59
        LCCDIR "../lib/signal.o",
60
        LCCDIR "../lib/stdio.o",
61
        LCCDIR "../lib/stdlib.o",
62
        LCCDIR "../lib/string.o",
63
        LCCDIR "../lib/time.o",
64
        LCCDIR "../lib/c1.o",
65
 
66
};
67
 
68
extern char *concat(char *, char *);
69
 
70
int option(char *arg) {
71
        if (strncmp(arg, "-lccdir=", 8) == 0) {
72
                cpp[0] = concat(&arg[8], "/cpp");
73
                include[0] = concat("-I", concat(&arg[8], "/include"));
74
                com[0] = concat(&arg[8], "/rcc");
75
                ld[18] = concat("-L", &arg[8]);
76
        } else if (strcmp(arg, "-kernel") == 0) {
77
                ld[8] = 0;
78
                ld[7] = ld[5];
79
                ld[6] = ld[3];
80
                ld[5] = ld[2];
81
                ld[4] = ld[1];
82
                ld[3] = "0xC0000000";
83
                ld[2] = "-rc";
84
                ld[1] = "-h";
85
        } else if (strcmp(arg, "-rom") == 0) {
86
                ld[8] = 0;
87
                ld[7] = ld[5];
88
                ld[6] = ld[3];
89
                ld[5] = ld[2];
90
                ld[4] = ld[1];
91
                ld[3] = "0xE0000000";
92
                ld[2] = "-rc";
93
                ld[1] = "-h";
94
        } else
95
                return 0;
96
        return 1;
97
}

powered by: WebSVN 2.1.0

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