/* Code for ECO32 under Linux, University of Applied Sciences Giessen */
|
/* Code for ECO32 under EOS32, University of Applied Sciences Giessen */
|
|
|
#include <string.h>
|
#include <string.h>
|
|
|
char *suffixes[] = { ".c", ".i", ".s", ".o", ".out", 0 };
|
char *suffixes[] = { ".c", ".i", ".s", ".o", ".out", 0 };
|
|
|
char inputs[256] = "";
|
char inputs[256] = "";
|
|
|
char *cpp[] = {
|
char *cpp[] = {
|
LCCDIR "cpp",
|
LCCDIR "cpp",
|
"-D__STDC__=1",
|
"-D__STDC__=1",
|
"-DLANGUAGE_C",
|
"-DLANGUAGE_C",
|
"-D_LANGUAGE_C",
|
"-D_LANGUAGE_C",
|
"-DECO32",
|
"-DECO32",
|
"-D_ECO32",
|
"-D_ECO32",
|
"-Deco32",
|
"-Deco32",
|
"-DUNIX",
|
"-DUNIX",
|
"-D_UNIX",
|
"-D_UNIX",
|
"-Dunix",
|
"-Dunix",
|
"$1", /* preprocessor include directory */
|
"$1", /* preprocessor include directory */
|
"$2", /* preprocessor input file */
|
"$2", /* preprocessor input file */
|
"$3", /* preprocessor output file */
|
"$3", /* preprocessor output file */
|
0
|
0
|
};
|
};
|
|
|
char *com[] = {
|
char *com[] = {
|
LCCDIR "rcc",
|
LCCDIR "rcc",
|
"-target=eco32/eos32",
|
"-target=eco32/eos32",
|
"$1", /* other options handed through */
|
"$1", /* other options handed through */
|
"$2", /* compiler input file */
|
"$2", /* compiler input file */
|
"$3", /* compiler output file */
|
"$3", /* compiler output file */
|
"",
|
"",
|
0
|
0
|
};
|
};
|
|
|
char *include[] = { "-I" "/usr/include", 0 };
|
char *include[] = { "-I" "/usr/include", 0 };
|
|
|
char *as[] = {
|
char *as[] = {
|
LCCDIR "as",
|
LCCDIR "as",
|
"-o", "$3", /* assembler output file */
|
"-o", "$3", /* assembler output file */
|
"$1", /* other options handed through */
|
"$1", /* other options handed through */
|
"$2", /* assembler input file */
|
"$2", /* assembler input file */
|
0
|
0
|
};
|
};
|
|
|
char *ld[] = {
|
char *ld[] = {
|
LCCDIR "ld",
|
LCCDIR "ld",
|
"-o", "$3", /* linker output file */
|
"-o", "$3", /* linker output file */
|
"$1", /* other options handed through */
|
"$1", /* other options handed through */
|
"/usr/lib/c0.o",
|
"/usr/lib/c0.o",
|
"$2",
|
"$2",
|
"/usr/lib/setjmp.o",
|
"/usr/lib/setjmp.o",
|
"/usr/lib/eos32sys.o",
|
"/usr/lib/eos32sys.o",
|
"/usr/lib/eos32lib.o",
|
"/usr/lib/eos32lib.o",
|
"/usr/lib/assert.o",
|
"/usr/lib/assert.o",
|
"/usr/lib/ctype.o",
|
"/usr/lib/ctype.o",
|
"/usr/lib/errno.o",
|
"/usr/lib/errno.o",
|
"/usr/lib/math.o",
|
"/usr/lib/math.o",
|
"/usr/lib/signal.o",
|
"/usr/lib/signal.o",
|
"/usr/lib/stdio.o",
|
"/usr/lib/stdio.o",
|
"/usr/lib/stdlib.o",
|
"/usr/lib/stdlib.o",
|
"/usr/lib/string.o",
|
"/usr/lib/string.o",
|
"/usr/lib/time.o",
|
"/usr/lib/time.o",
|
"/usr/lib/c1.o",
|
"/usr/lib/c1.o",
|
0
|
0
|
};
|
};
|
|
|
extern char *concat(char *, char *);
|
extern char *concat(char *, char *);
|
|
|
int option(char *arg) {
|
int option(char *arg) {
|
if (strncmp(arg, "-lccdir=", 8) == 0) {
|
if (strncmp(arg, "-lccdir=", 8) == 0) {
|
cpp[0] = concat(&arg[8], "/cpp");
|
cpp[0] = concat(&arg[8], "/cpp");
|
include[0] = concat("-I", concat(&arg[8], "/include"));
|
include[0] = concat("-I", concat(&arg[8], "/include"));
|
com[0] = concat(&arg[8], "/rcc");
|
com[0] = concat(&arg[8], "/rcc");
|
ld[18] = concat("-L", &arg[8]);
|
ld[18] = concat("-L", &arg[8]);
|
} else if (strcmp(arg, "-kernel") == 0) {
|
} else if (strcmp(arg, "-kernel") == 0) {
|
ld[8] = 0;
|
ld[8] = 0;
|
ld[7] = ld[5];
|
ld[7] = ld[5];
|
ld[6] = ld[3];
|
ld[6] = ld[3];
|
ld[5] = ld[2];
|
ld[5] = ld[2];
|
ld[4] = ld[1];
|
ld[4] = ld[1];
|
ld[3] = "0xC0000000";
|
ld[3] = "0xC0010000";
|
ld[2] = "-rc";
|
ld[2] = "-rc";
|
ld[1] = "-h";
|
ld[1] = "-h";
|
} else if (strcmp(arg, "-rom") == 0) {
|
} else if (strcmp(arg, "-rom") == 0) {
|
ld[8] = 0;
|
ld[8] = 0;
|
ld[7] = ld[5];
|
ld[7] = ld[5];
|
ld[6] = ld[3];
|
ld[6] = ld[3];
|
ld[5] = ld[2];
|
ld[5] = ld[2];
|
ld[4] = ld[1];
|
ld[4] = ld[1];
|
ld[3] = "0xE0000000";
|
ld[3] = "0xE0000000";
|
ld[2] = "-rc";
|
ld[2] = "-rc";
|
ld[1] = "-h";
|
ld[1] = "-h";
|
} else
|
} else
|
return 0;
|
return 0;
|
return 1;
|
return 1;
|
}
|
}
|
|
|