/* UFO cross-compiler running under Windows */ #include #include #include static char rcsid[] = "$Id: win32.c,v 1.19 2001/07/09 18:00:13 drh Exp $"; //#ifndef LCCDIR #define LCCDIR "\"C:\\Program Files\\lcc-s\\" //#endif #ifdef UTSA #define TARGET "utsa" char *suffixes[] = { ".c;.C", ".i;.I", ".asm;.ASM;.s;.S", ".utsa", "", 0 }; char *ld[] = { "perl", LCCDIR "linker.pl\"", "-path" LCCDIR "lib\"", "-llcc", "-o$3", "$1", "$2", 0 }; char *as[] = { "cp", "$1", "$2", "$3", 0 }; #define PATH "-path" #else #define TARGET "ufo" char *suffixes[] = { ".c;.C", ".i;.I", ".asm;.ASM;.s;.S", ".ufo;.UFO", ".out", 0 }; char *ld[] = { LCCDIR "link-" TARGET ".exe\"", "-path" LCCDIR "lib\"", "-llcc", "-e", "-n", "-o$3", "$1", "$2", 0 }; char *as[] = { LCCDIR "as-" TARGET ".exe\"", "-o$3", "$1", "$2", 0 }; #endif char inputs[256] = ""; char *cpp[] = { LCCDIR "cpp.exe\"", "", "-D_" TARGET, "$1", "$2", "$3", 0 }; char *include[] = { "", "", 0 }; char *com[] = { LCCDIR "scc.exe\"", "-target=" TARGET, "$1", "$2", "$3", 0 }; char *peep[] = { LCCDIR "peep-" TARGET ".exe\"", "$1", "$2", 0 }; extern char *concat(char *, char *); extern char *replace(const char *, int, int); int option(char *arg) { if (strncmp(arg, "-L", 2) == 0) { arg = replace(arg + 2, '/', '\\'); if (arg[strlen(arg)-1] == '\\') arg[strlen(arg)-1] = '\0'; cpp[0] = concat(arg, "\\cpp"); include[0] = concat("-I", concat(arg, "\\include")); com[0] = concat(arg, "\\scc"); as[0] = concat(arg, "\\as-" TARGET); peep[0] = concat(arg, "\\peep-" TARGET); #ifdef UTSA ld[1] = concat(arg, "\\linker.pl"); ld[2] = concat("-path", concat(arg, "\\lib")); } else if (strncmp(arg, "-ld=", 4) == 0) ld[1] = &arg[4]; #else ld[0] = concat(arg, "\\link-" TARGET); ld[1] = concat("-path", concat(arg, "\\lib")); } else if (strncmp(arg, "-ld=", 4) == 0) ld[0] = &arg[4]; #endif else return 0; return 1; }