00001
00002
00003 #include <string.h>
00004
00005
00006 #ifndef LCCDIR
00007
00008
00009
00010 #define LCCDIR ""
00011 #endif
00012
00013 char *suffixes[] = { ".c;.C", ".i;.I", ".asm;.ASM;.s;.S", ".obj;.OBJ", ".exe", 0 };
00014 char inputs[256] = "";
00015 char *cpp[] = { LCCDIR "q3cpp", "-D__STDC__=1", "-Dwin32", "-D_WIN32", "-D_M_IX86",
00016 "$1", "$2", "$3", 0 };
00017 char *include[] = { "-I" LCCDIR "include", 0 };
00018 char *com[] = { LCCDIR "q3rcc", "-target=x86/win32", "$1", "$2", "$3", 0 };
00019 char *as[] = { "ml", "-nologo", "-c", "-Cp", "-coff", "-Fo$3", "$1", "$2", 0 };
00020 char *ld[] = { "link", "-nologo",
00021 "-align:0x1000", "-subsystem:console", "-entry:mainCRTStartup",
00022 "$2", "-OUT:$3", "$1", LCCDIR "liblcc.lib", "libc.lib", "kernel32.lib", 0 };
00023
00024 extern char *concat(char *, char *);
00025 extern char *replace(const char *, int, int);
00026
00027 int option(char *arg) {
00028 if (strncmp(arg, "-lccdir=", 8) == 0) {
00029 arg = replace(arg + 8, '/', '\\');
00030 if (arg[strlen(arg)-1] == '\\')
00031 arg[strlen(arg)-1] = '\0';
00032 cpp[0] = concat(arg, "\\cpp.exe");
00033 include[0] = concat("-I", concat(arg, "\\include"));
00034 com[0] = concat(arg, "\\rcc.exe");
00035 ld[8] = concat(arg, "\\liblcc.lib");
00036 } else if (strcmp(arg, "-b") == 0)
00037 ;
00038 else if (strncmp(arg, "-ld=", 4) == 0)
00039 ld[0] = &arg[4];
00040 else
00041 return 0;
00042 return 1;
00043 }