Quake-III-Arena

Quake III Arena GPL Source Release
Log | Files | Refs

win32.c (1397B)


      1 /* x86s running MS Windows NT 4.0 */
      2 
      3 #include <string.h>
      4 
      5 
      6 #ifndef LCCDIR
      7 // JDC #define LCCDIR "\\progra~1\\lcc\\4.1\\bin\\"
      8 //#define LCCDIR "\\quake3\\source\\lcc\\bin\\"	// JDC
      9 // TTimo: q3cpp q3rcc & no hardcoded paths
     10 #define LCCDIR ""
     11 #endif
     12 
     13 char *suffixes[] = { ".c;.C", ".i;.I", ".asm;.ASM;.s;.S", ".obj;.OBJ", ".exe", 0 };
     14 char inputs[256] = "";
     15 char *cpp[] = { LCCDIR "q3cpp", "-D__STDC__=1", "-Dwin32", "-D_WIN32", "-D_M_IX86",
     16 	"$1", "$2", "$3", 0 };
     17 char *include[] = { "-I" LCCDIR "include", 0 };
     18 char *com[] = { LCCDIR "q3rcc", "-target=x86/win32", "$1", "$2", "$3", 0 };
     19 char *as[] = { "ml", "-nologo", "-c", "-Cp", "-coff", "-Fo$3", "$1", "$2", 0 };
     20 char *ld[] = { "link", "-nologo", 
     21 	"-align:0x1000", "-subsystem:console", "-entry:mainCRTStartup",
     22 	"$2", "-OUT:$3", "$1", LCCDIR "liblcc.lib", "libc.lib", "kernel32.lib", 0 };
     23 
     24 extern char *concat(char *, char *);
     25 extern char *replace(const char *, int, int);
     26 
     27 int option(char *arg) {
     28 	if (strncmp(arg, "-lccdir=", 8) == 0) {
     29 		arg = replace(arg + 8, '/', '\\');
     30 		if (arg[strlen(arg)-1] == '\\')
     31 			arg[strlen(arg)-1] = '\0';
     32 		cpp[0] = concat(arg, "\\cpp.exe");
     33 		include[0] = concat("-I", concat(arg, "\\include"));
     34 		com[0] = concat(arg, "\\rcc.exe");
     35 		ld[8] = concat(arg, "\\liblcc.lib");
     36 	} else if (strcmp(arg, "-b") == 0)
     37 		;
     38 	else if (strncmp(arg, "-ld=", 4) == 0)
     39 		ld[0] = &arg[4];
     40 	else
     41 		return 0;
     42 	return 1;
     43 }